Two JQ calls to Ajax errors

Source: Internet
Author: User

In the last two days of projects, Ajax is often used to Create Ajax objects using normal Js. Since my brother became obsessed with jquery, he wrote things and found kung fu with JQ, but he still made mistakes.

There are two errors in calling the Ajax method by using JQ below. I hope you can keep them in mind.

 

 

$. Ajax ({
Type: "Post", // Ajax Request Method
URL: URL, // Ajax request address
Datatype: "JSON", // accept the JSON Data Format
Contenttype: "application/JSON; UTF-8", // sets the Data Transmission Character Set
Data: "picid =" + picid + "& Title =" + title + "& catid_one =" + catid_one + "& catid_two =" + catid_two + "& Action = next ", // pass the post Parameter
Timeout: 25000, // set the timeout value
Error: showerror, // Ajax call failure Function
Success: showpic_info, // Ajax call success Function
});

 

Error 1 I seem to have been fooled by an unknown JQ manual.

Data: "picid =" + picid + "& Title =" + title + "& catid_one =" + catid_one + "& catid_two =" + catid_two + "& Action = next ", // pass the post parameter and find that passing the parameter in this way is a big error. This should be post in the form of a parameter passed by the get method.

It should be as follows:

 

Data: {picid: picid, Title: title, catid_one: catid_one, catid_two: catid_two, Action: 'Next'}, // pass the post Parameter

 

More than 2 errors, success: showpic_info,
// Ajax call success function $. Ajax ({.....}); There is no ending point in the braces ", I don't know why I accidentally wrote it. Isn't it my habit of developing code over the years? e ........... A mess of Failures

 

Alas, I still don't know how to solve the problem when I encountered this problem. I just saw Firefox completely normal, firebug monitoring, and IE, but it was a crash. I think Firefox never prompts JavaScript errors. there are JS syntax errors, and then you can observe the Code for a long time, it seems that there should not be another .... Hey, you're done.

 

If you have any JQ problems with these two minor issues, please note that

 

 







 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.