Home >Backend Development >PHP Tutorial >Ajax delivery path problems and solutions
In the process of using Ajax, if you want to pass the path value to the processing page through JSON, the value will be passed incorrectly.
The solution is to encode the path before passing the value:
In JS:
encodeURIComponent(url)
In the processing page, decode the received path variable:
Processing page Medium:
urldecode($_POST["pic"]);
The above introduces the problem and solution of Ajax delivery path, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.