Do you know the meaning of special symbols in URL?

Do you know the meaning of special symbols in URL?

1.#

# represents a location in a web page. The character to the right is the identifier of that position. For example, http://www.example.com/index.html#print represents the print location of the web page index.html. After the browser reads this URL, it will automatically scroll the print position to the visible area.

There are two ways to specify an identifier for a web page location. One is to use anchor points, such as <a name="print"></a>, and the other is to use id attributes, such as <div id="print">.

2. HTTP request does not include#

# is used to guide browser actions and is completely useless on the server side. Therefore, the HTTP request does not include #.

For example, when accessing the following URL, http://www.example.com/index.html#print, the request actually sent by the browser is as follows:

XML/HTML CodeCopy content to clipboard
  1. GET /index.html HTTP/1.1
  2. Host: www.example.com

3. Characters after #

Any characters that appear after the first # are interpreted by the browser as a location identifier. This means that none of these characters will be sent to the server.

For example, the following URL is intended to specify a color value: http://www.example.com/?color=#fff, but the request actually sent by the browser is:

XML/HTML CodeCopy content to clipboard
  1. GET /? color = HTTP /1.1
  2. Host: www.example.com

4. Change #Do not trigger web page reload

By simply changing the part after #, the browser will only scroll to the corresponding position without reloading the web page.

For example, if you change from http://www.example.com/index.html#location1 to http://www.example.com/index.html#location2, the browser will not request index.html from the server again.

5. Changing # will change the browser's access history

Every time you change the part after #, a record will be added to the browser's access history. You can use the "Back" button to return to the previous location. This is particularly useful for Ajax applications, where you can use different # values ​​to represent different access states, and then provide users with a link to access a certain state. It is worth noting that the above rules do not apply to IE 6 and IE 7, which will not add history records due to changes in #.

6. window.location.hash reads #value

The window.location.hash property is readable and writable. When reading, it can be used to determine whether the status of the web page has changed; when writing, it will create an access history record without reloading the web page.

7. onhashchange event

This is a new event in HTML 5. When the # value changes, this event will be triggered. This event is supported by IE8+, Firefox 3.6+, Chrome 5+, and Safari 4.0+.

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 changes in location.hash.

8. Google's mechanism for crawling #

By default, Google's web spiders ignore the # portion of a URL.

However, Google also stipulates that if you want the content generated by Ajax to be read by the browsing engine, you can use "#!" in the URL, and Google will automatically convert the content after it into the value of the query string _escaped_fragment_.

For example, Google found the URL of the new version of Twitter: http://twitter.com/#!/username

It will automatically fetch another URL: http://twitter.com/?_escaped_fragment_=/username

Through this mechanism, Google can index dynamic Ajax content.

Note

AJAX = Asynchronous JavaScript and XML (a subset of Standard Generalized Markup Language). AJAX is a technology for creating fast, dynamic web pages.

2. ?

1) Connecting function: for example

XML/HTML CodeCopy content to clipboard
  1. http://www.xxx.com/Show.asp?id=77 nameid = 2905210001 page = 1   

2) Clear the cache: For example

XML/HTML CodeCopy content to clipboard
  1. http://www.xxxxx.com/index.html
  2. http://www.xxxxx.com/index.html?test123123

The pages opened by the two URLs are the same, but there is a question mark at the end, which means that the cached content is not called, but it is considered to be a new address and is read again.

3. &

Separators for different parameters

JavaScript CodeCopy content to clipboard
  1. import java.util.ArrayList;
  2.   
  3. class Node{
  4.      int val;
  5. Node leftNode;
  6. Node rightNode;
  7.      public Node( int val, Node leftNode, Node NodeRight){
  8.          this .val = val;
  9.          this .leftNode = leftNode;
  10.          this .rightNode = rightNode;
  11. }
  12. }
  13. public   class InOrder{
  14.        
  15.      static ArrayList<Integer> arrayList = new ArrayList<Integer>();
  16.        
  17.      public   static   void main(String args[]){
  18.          //Construct the tree   
  19. Node E = new Node(5, null , null );
  20. Node D = new Node(4, null , null );
  21. Node C = new Node(3, null , null );
  22. Node B = new Node(2, D, E);
  23. Node A = new Node(1, B, C);
  24.            
  25. inOrder(A);
  26.          for ( int i = 0; i < arrayList.size(); i++) {
  27.              //System.out.print(arrayList.get(i)+" ");   
  28. }
  29. }
  30.        
  31.      public   static   void inOrder(Node root){
  32.          if (root != null ){
  33. inOrder(root.leftNode);
  34. arrayList.add(root.val);
  35. inOrder(root.rightNode);
  36. System.err.print(root.rightNode + " " );
  37. }
  38. }
  39. }

What is the difference between JavaBean and POJO:

In a word, pojo with set and get methods are javabeans. But JavaBean has more than just setting and getting, and any Java class 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 old-fashioned Java object", but everyone calls it "simple Java object". The intrinsic meaning of POJO refers to Java objects that do not inherit from any class, do not implement any interface, and are not invaded by other frameworks.

Comparison between POJO and JavaBean

The pojo format is used for temporary data transmission. It can only load data as a carrier for data storage, but does not have 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 JAVA language. Its method naming, construction, and behavior must conform to 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 follow standard naming conventions.
3. This class should be serializable.

Original URL: http://www.cnblogs.com/androidshouce/archive/2016/06/17/5592867.html

<<:  Detailed explanation of scp and sftp commands under Linux

>>: 

Recommend

Detailed discussion of MySQL stored procedures and stored functions

1 Stored Procedure 1.1 What is a stored procedure...

JS implements simple calendar effect

This article shares the specific code of JS to ac...

How to install Nginx in CentOS7 and configure automatic startup

1. Download the installation package from the off...

Linux type version memory disk query command introduction

1. First, let’s have a general introduction to th...

How to implement remote connection for Redis under Linux

After installing Redis on Linux, use Java to conn...

MySQL 5.7.19 winx64 free installation version configuration tutorial

mysql-5.7.19-winx64 installation-free version con...

MySQL paging performance exploration

Several common paging methods: 1. Escalator metho...

Mysql experiment: using explain to analyze the trend of indexes

Overview Indexing is a skill that must be mastere...

How to allow all hosts to access mysql

1. Change the Host field value of a record in the...

How to delete extra kernels in Ubuntu

Step 1: View the current kernel rew $ uname -a Li...

Pure JS method to export table to excel

html <div > <button type="button&qu...

Implementation of MySQL scheduled database backup (full database backup)

Table of contents 1. MySQL data backup 1.1, mysql...