one,#
# represents a location in the webpage. The character on the right is the identifier of the position. For example, /#print represents the print location of the web page. After the browser reads this URL, the print position will automatically scroll to the visible area.
There are two ways to specify an identifier for the page location. First, use anchor points, such as <a name="print"></a>, and second, use id attributes, such as <div>.
2. HTTP request does not include#
# is used to guide browser actions and is completely useless to the server side. Therefore, # is not included in the HTTP request.
For example, if you visit the following URL, /#print, the actual request issued by the browser is as follows:
GET / HTTP/1.1
Host:
3. Characters after #
Any character that appears after the first # will be interpreted by the browser as a location identifier. This means that none of these characters are sent to the server side.
For example, the original meaning of the following URL is to specify a color value: /?color=#fff, but the actual request issued by the browser is:
GET /?color= HTTP/1.1
Host:
4. Change # does not trigger web page reload
The browser will only scroll to the corresponding position after changing the # part and will not reload the web page.
For example, from/#location1Change to /#location2, and the browser will not re-request from the server.
5. Change# will change the browser's access history
Each time the part after changing # will add a record to the browser's access history. Use the "Back" button to return to the previous position. This is especially useful for ajax applications, which can use different # values to represent different access states, and then give the user a link to access a certain state. It is worth noting that the above rules do not hold true for IE 6 and IE 7, and they will not add history due to changes in #.
6. Read #value
This property is readable and writable. When reading, it can be used to determine whether the web page status changes; when writing, it will create an access history without overloading the web page.
7. onhashchange event
This is an event added to HTML 5, which will trigger when the # value changes. IE8+, Firefox 3.6+, Chrome 5+, Safari 4.0+ support this event.
It is used in three ways:
• = func;
•<body onhashchange="func();">
•("hashchange", func, false);
For browsers that do not support onhashchange, you can use setInterval to monitor changes.
8. The mechanism of Google crawling#
By default, Google's web spider ignores the # part of the URL.
However, Google also stipulates that if you want Ajax generated content to be read by the browsing engine, you can use "#!" in the URL, and Google will automatically convert the content after it to the value of the query string _escaped_fragment_.
For example, Google discovered the URL of the new version of Twitter: /#!/username
Another URL will be automatically crawled: /?_escaped_fragment_=/username
Through this mechanism, Google can index dynamic Ajax content.
Note
AJAX = Asynchronous JavaScript and XML (subset of standard universal markup languages). AJAX is a technology used to create fast dynamic web pages.
2. ?
1) Connection function: For example
/?id=77&nameid=2905210001&page=1
2) Clear the cache: For example
/
/?test123123
The pages opened by the two urls are the same, but the following one has a question mark, indicating that the cached content is not called, but is considered a new address and re-read.
3. &
Spacer for different parameters
import ; class Node{ int val; Node leftNode; Node rightNode; public Node(int val, Node leftNode, Node NodeRight){ = val; = leftNode; = rightNode; } } public class InOrder{ static ArrayList<Integer> arrayList = new ArrayList<Integer>(); public static void main(String args[]){ //Construct the treeNode E = new Node(5, null, null); Node D = new Node(4, null, null); Node C = new Node(3, null, null); Node B = new Node(2, D, E); Node A = new Node(1, B, C); inOrder(A); for(int i = 0;i <();i++){ //((i)+" "); } } public static void inOrder(Node root){ if(root != null){ inOrder(); (); inOrder(); ( + " "); } } }
What is the difference between javabean and POJO:
In a word, pojo with set and get methods is javabeans. However, in addition to setting and getting, any javabean can be a javabean.
What is POJO
According to Martin Fowler's explanation, it is "Plain Old Java Object", which is literally translated as "pure and old-fashioned java object", but everyone uses "simple java object" to call it. The inherent meaning of POJO refers to java objects that have not inherited from any class, implemented any interface, and have not been invaded by other frameworks.
Comparison between pojo and javabean
The format of pojo is used for temporary data transfer. It can only load data and serve as a carrier for data storage without the ability to process business logic.
Although the data acquisition of javabean is the same as that of pojo, there are other methods in javabean.
JavaBean is a reusable component written in the JAVA language. Its method naming, structure and behavior must comply with specific conventions:
1. This class must have a public default constructor.
2. The properties of this class are accessed using getters and setters, and other methods comply with standard naming specifications.
3. This class should be serializable.
The above is the relevant knowledge about what the special symbols in the url are (recommended) introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support for my website!