Do you know the meaning of special symbols in URLs?

Source: Internet
Author: User

1.#

#代表网页中的一个位置. The character to the right is the identifier for that position. For example, Http://www.example.com/index.html#print represents the print position of the page index.html. When the browser reads the URL, it automatically scrolls the print position to the viewable area.
There are two methods for specifying an identifier for the page location. One is the use of anchor points, such as <a name= "print" ></a>, and the second is the use of ID attributes, such as <div id= "print" >.

Second, the HTTP request does not include #
#是用来指导浏览器动作的, completely useless on the server side. Therefore, # is not included in the HTTP request.
For example, to visit the following URL, Http://www.example.com/index.html#print, the browser actually makes a request like this:

Get/index.html http/1.1host:www.example.com

Third, #后的字符
Any character that appears after the first # is interpreted by the browser as a positional identifier. This means that none of these characters will be sent to the server side.
For example, the intent of the following URL is to specify a color value: http://www.example.com/?color= #fff, but the actual request the browser makes is:

GET/?color= http/1.1host:www.example.com

Iv. Change # does not trigger page reload
Simply change the part of the #, the browser will only scroll to the appropriate location and will not reload the page.
For example, change from Http://www.example.com/index.html#location1 to Http://www.example.com/index.html#location2, The browser does not re-request index.html to the server.

V. Change # will change the browser's access history
Each time you change the # section, you add a record to your browser's access history and use the back button to go back to the previous location. This is especially useful for Ajax applications, where you can use different # values to represent different access states, and then give the user a link to access a state. It is important to note that the above rules do not hold for IE 6 and IE 7, they will not increase the historical record because of the change of #.
  

Six, Window.location.hash read # value
Window.location.hash This property can be read and writable. When read, it can be used to determine if the state of the Web page changes, and when it is written, it creates an access history without reloading the page.
  

Vii. Events of Onhashchange
This is a new HTML 5 event that will be triggered when the # value changes. ie8+, Firefox 3.6+, Chrome 5+, Safari 4.0+ support this event.
There are three ways to use it:

    • Window.onhashchange = func;
    • <body onhashchange= "func ();" >
    • Window.addeventlistener ("Hashchange", Func, false);

For browsers that do not support onhashchange, you can use SetInterval to monitor location.hash changes.

Eight, Google crawl # mechanism
By default, Google's web spiders ignore the # portion of the URL.
However, Google also stipulates that if you want AJAX-generated content to be read by the browsing engine, the URL can use "#!", and Google will automatically convert the content behind it into the value of the query string _escaped_fragment_.
For example, Google found that the new version of Twitter's url:http://twitter.com/#!/username

It will automatically fetch another url:http://twitter.com/?_escaped_fragment_=/username
With this mechanism, Google can index dynamic AJAX content.

Note

AJAX = Asynchronous JavaScript and XML (a subset of standard generic markup languages). AJAX is a technique for creating fast, Dynamic Web pages.

2.?

1) connection function: for example

Http://www.xxx.com/Show.asp?id=77&nameid=2905210001&page=1

2) Clear the cache: for example,

Http://www.xxxxx.com/index.html http://www.xxxxx.com/index.html?test123123

Two URLs open the same page, but this one has a question mark, indicating that the cached content is not called, but is considered a new address, re-read.

3. &

Spacers for different parameters

Importjava.util.ArrayList;classnode{intVal;    Node Leftnode;    Node Rightnode;  PublicNode (intVal, node leftnode, node Noderight) {         This. val =Val;  This. Leftnode =Leftnode;  This. Rightnode =Rightnode; }} Public classinorder{StaticArraylist<integer> ArrayList =NewArraylist<integer>();  Public Static voidMain (String args[]) {//Construction TreeNode E =NewNode (5,NULL,NULL); Node D=NewNode (4,NULL,NULL); Node C=NewNode (3,NULL,NULL); Node B=NewNode (2, D, E); Node A=NewNode (1, B, C);        Inorder (A);  for(inti = 0;i <arraylist.size (); i++){            //System.out.print (Arraylist.get (i) + "");        }    }         Public Static voidinorder (Node root) {if(Root! =NULL) {inorder (Root.leftnode);            Arraylist.add (Root.val);            Inorder (Root.rightnode); System.err.print (Root.rightnode+ "  "); }    }}

What is the difference between JavaBean and Pojo:

In a word, pojo with set and get methods is JavaBeans. But JavaBean in addition to setting and getting there are other, any Java class can be javabean.

What is Pojo

According to Martin Fowler's explanation is "Plain old Java object", literally translated as "pure older Java objects", but everyone uses "simple Java object" to call it. The intrinsic meaning of Pojo refers to Java objects that do not inherit from any class, do not implement any interfaces, and are not invaded by other frameworks.

Comparison of Pojo and JavaBean

The Pojo format is used for temporary transfer of data, which can only load data as a carrier of data storage, without the ability to handle business logic.

JavaBean Although the data acquisition and Pojo the same, but JavaBean can have other methods.

JavaBean is a reusable component written in the Java language. Its method naming, construction and behavior must conform to a specific convention:

    1. This class must have a public default constructor.
    2. The properties of this class are accessed using getter and setter, and other methods conform to standard naming conventions.
    3. This class should be serializable.

Do you know the meaning of special symbols in URLs?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.