Home >Backend Development >PHP Tutorial >Ajax delivery path problems and solutions

Ajax delivery path problems and solutions

WBOY
WBOYOriginal
2016-07-29 08:56:02990browse

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn