Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Conversion of javascript strings
Conversion of javascript strings
1. If it is rotated manually, replace the characters with the corresponding characters with the replace () function.

2. There is a special coding function in 2.js that can be converted into 16: encodeURI ().

Escape encoding of special characters in URL

Character URL encoded value

Space -%20

" - %22

# - %23

% - %25

& amp- %26

( - %28

) - %29

+ - %2B

,- %2C

/ - %2F

:- %3A

; - %3B

& lt- %3C

= - %3D

& gt- %3E

- %3F

@ - %40

\ - %5C

| - %7C

URL special character escape

The special meanings and basic coding rules of some characters in URL are as follows:

1, space with plus sign (+)

2. A forward slash (/) separates directories and subdirectories.

3. Question mark (? ) separate the website and query.

4. The percent sign (%) develops special characters.

5, # Specify bookmark

6. The ampersand separates the parameters

If it needs to be used in URL, these special characters need to be replaced with corresponding hexadecimal values.

+ %2B

/ %2F

%3F

% %25

# %23

& amp%26

Because AJAX is often used in projects to transmit SQL to background servers.

You will encounter select num+ 1 from double or left-right connections. Always lose (+)

At this time, you can try to escape with URL special characters.

Use the encodeURI () function of JS or directly change it to the corresponding hexadecimal value.

Look at the introduction of encodeURI function on the internet, which is also about URI escape.

Answer from another question: Know the search word-"What does Baidu's% symbol mean?"

Because Du Niang will swallow the link, so I might as well link it.