Home > Article > Web Front-end > Two methods to solve javascript url post special character escape + & #_jquery
Recently, I found that data was lost when using URL to transmit special characters.
In fact, it is not lost. For example, ‘+’ will be treated as a connecting character.
1. Replace with hexadecimal characters. Here are some common conversions
+ | 空格 | / | ? | % | & | = | # |
%2B | %20 | %2F | %3F | %25 | %26 | &3D | %23 |
2. If you encounter other special characters, you can use the following method to see what to convert it into. Just write one according to the above method