


How to handle html tag submission failure when Ajax submits parameters
This time I will bring you the html tag when Ajax submits parameters How to handle the submission failure, what are the things to pay attention to when handling the html tag submission failure when handling Ajax submission parameters, the following is the actual combat Let’s take a look at the case.
Recently, I encountered a small problem in the company's resource and article upload function, and I was stuck for a long time. This function is similar to using rich text There has been no problem running the code locally and the submission can always be successful. However, when the code is deployed online, the data cannot be submitted successfully. I was stuck for a long time and it took me a long time to find the problem. The reason why the submission was unsuccessful is because my submission data contains html tags, and my target address cannot be directly requested.# Then the solution is as follows:
1. Use JS's base64 coding (similar to encrypted) on the page with the parameter value of HTML tags. 2. After obtaining the data at the target address, use the background Base64 decoding method to decode the obtained data. The following is the Base64 encoding and decoding method code of my JS:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
1 2 |
|
The solution is as follows:
I first used the JS method replace() method to replace, but there was an error. JS just replaced my first A space is replaced with a plus sign (+). The final solution is as follows. In the background (under the target receiving address), replace the spaces with the plus sign (+) for the obtained data. The code is as follows:1 2 3 4 5 6 7 8 9 |
|
Asynchronous file or image upload ajax
Based on Ajax technology to achieve refresh-free user login ( Code attached)
The above is the detailed content of How to handle html tag submission failure when Ajax submits parameters. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.
