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

Ajax delivery path problems and solutions

WBOY
Release: 2016-07-29 08:56:02
Original
988 people have browsed it

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)
Copy after login

In the processing page, decode the received path variable:

Processing page Medium:

urldecode($_POST["pic"]);
Copy after login


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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template