Home >Web Front-end >JS Tutorial >Solution to the problem that jQuery does not have permission when clicking on form submission_jquery

Solution to the problem that jQuery does not have permission when clicking on form submission_jquery

WBOY
WBOYOriginal
2016-05-16 16:41:101178browse

I encountered a problem today. When I click on the form to submit, jQuery does not have permission;

Baidu searched a lot for reasons such as jquery cross-domain. After comparing the projects, I found that there is no such reason; but I was still inspired by it. Using json can prevent such problems, but the methods they provide are relatively It’s complicated and requires changing the front and backend.

I tried the json method that comes with jquery and submitted it successfully!

$.post("actionName.action",{"id":值,"name":值},
function(data){
if(data=="ok"){
alert(ok)
}
})
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