Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that the html tag in the value of the Ajax submission parameter cannot be submitted successfully

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "how to solve the problem that the value of Ajax submission parameters can not be submitted successfully with html tag". In daily operation, I believe that many people have doubts about how to solve the problem that the value of Ajax submission parameters can not be submitted successfully with html tag. The editor consulted all kinds of materials and sorted out simple and useful operation methods. I hope it will be helpful to answer the question of "how to solve the problem that the value of the Ajax submission parameter with the html tag cannot be submitted successfully"! Next, please follow the editor to study!

The solution is as follows:

1, in the page with JS Base64 encoding (similar to encryption) with html tag parameter values.

2. After the data is obtained from the target address, the background Base64 decoding method can be used to decode the obtained data.

The following is the Base64 encoding and decoding method code for my JS:

/ / here are 64 basic codes var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" Var base64DecodeChars = new Array (- 1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,-1,-1,-1,-1,-1,-1, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,-1, 1,-1,-1 -1) / / function base64encode (str) {var out, I, len; var C1, c2, c3; len = str.length; I = 0; out = ""; while (I)

< len) { c1 = str.charCodeAt(i++) & 0xff; if(i == len) { out += base64EncodeChars.charAt(c1 >

> 2); out + = base64EncodeChars.charAt ((C1 & 0x3) > 2); out + = base64EncodeChars.charAt ((C1 & 0x3) > 4); out + = base64EncodeChars.charAt ((c2 & 0xF) > 2); out + = base64EncodeChars.charAt ((C1 & 0x3) > 4); out + = base64EncodeChars.charAt ((c2 & 0xF) > 6); out + = base64EncodeChars.charAt (c3 & 0x3F);} return out } / / Decoding method function base64decode (str) {var C1, c2, c3, c4; var I, len, out; len = str.length; I = 0; out = ""; while (I

< len) { do { c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff]; } while(i < len && c1 == -1); if(c1 == -1) break; do { c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff]; } while(i < len && c2 == -1); if(c2 == -1) break; out += String.fromCharCode((c1 >

4)); do {c3 = str.charCodeAt (iTunes +) & 0xff; if (c3 = = 61) return out; c3 = base64DecodeChars [c3];} while (I

< len && c3 == -1); if(c3 == -1) break; out += String.fromCharCode(((c2 & 0XF) >

); do {c4 = str.charCodeAt (iTunes +) & 0xff; if (c4 = = 61) return out; c4 = base64DecodeChars [c4];} while (I

< len && c4 == -1); if(c4 == -1) break; out += String.fromCharCode(((c3 & 0x03) = 0x0001) && (c 0x07FF) { out += String.fromCharCode(0xE0 | ((c >

> 12) & 0x0F); out + = String.fromCharCode (0x80 | (c > > 6) & 0x3F); out + = String.fromCharCode (0x80 | (c > 0) & 0x3F));} else {out + = String.fromCharCode (0xC0 | (c > 6) & 0x1F); out + = String.fromCharCode (0x80 | (c > 0) & 0x3F)) }} return out;} function utf8to16 (str) {var out, I, len, c; var char2, char3; out = ""; len = str.length; I = 0; while (I

< len) { c = str.charCodeAt(i++); switch(c >

> 4) {case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: / / 0xxxxxxx out + = str.charAt (iMub 1); break; case 12: case 13: / / 110x xxxx 10xx xxxx char2 = str.charCodeAt (iTunes +); out + = String.fromCharCode (c & 0x1F))

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report