Ajax submission unresponsive solution in IE jquery.form

Source: Internet
Author: User
Tags trim

Spent three head, repeatedly check, found that the original is changed processing page return header information.
With the Application/x-javascript, IE8 no work.
If it is text/html, it is OK, or it is not specified.
Is it a bug? Let me say hello to the IE developer who wrote this piece of code.

Ajax header information, coding seems to pay attention to hey.

Introduction to the way Ajax submits form data

Number of URL parameter submissions

The code is as follows Copy Code
<script type = "Text/javascript" src = ". /js/jquery.js "></script>
<script type= "Text/javascript" >
function checkcorpid ()//Check if customer number is available
{
if ($.trim ("#txtF_CORPID") [0].value) = "")//txtf_corpid is the customer number input box
{
Alert ("Please enter customer number!");
}
Else
{
$ ("#checkFlag"). HTML ("detecting");//display of prompts
$.ajax ({
Type: "Get",
URL: "Checkcorpid.ashx",
Data: "Id=" +$.trim ($ ("#txtF_CORPID") [0].value),//Submit form, equivalent to Checkcorpid.ashx?id=xxx
Success:function (msg) {$ ("#checkFlag"). HTML (""); alert (msg); Operation after the successful operation! MSG is a backstage pass.
});
}
}
</script>


Two: Form submission data foreground code:

The code is as follows Copy Code

<script type = "Text/javascript" src = ". /js/jquery.js "></script>//Must be referenced
<script type = "Text/javascript" src = ". /js/jquery.form.js "></script>//Must be referenced
<script type= "Text/javascript" >
Wait for the DOM to be loaded
$ (document). Ready (function ()
{
$ (' #Tip '). Hide ()//The element that displays the action hint is not visible
$ (' #form1 '). Submit (function ()/form
{
Alert ("ddd");
var options = {
Target: ' #Tip ',//background will assign the passed value to the element.
URL: ' Returnvisit.aspx?flag=do ',//submitted to which execution
Type: ' POST ',
Success:function () {Alert ($ (' #Tip '). text ());//Show Action Tips
};
$ (' #form1 '). Ajaxsubmit (options);
return false; In order not to refresh the page, return false, anyway, has been done in the background, nothing!

               });  
           }
         );
     </script>
 

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.