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
Copy Code code as follows:
<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 submits the data foreground code:
Code
Copy Code code as follows:
<script type = "Text/javascript" src = ". /js/jquery.js "></script>//must refer to
<script type =" Text/javascript "src =". /js/jquery.form.js "></script>//must reference the
<script type=" Text/javascript ">
//wait for the DOM Loaded
$ (document). Ready (function ()
{
$ (' #Tip '). Hide ();//display action prompt element not visible
$ (' #form1 '). Submit (function ()//Submit the form
{
//alert ("ddd");
var options = {
Target: ' #Tip ',//background will assign the passed value to the element
URL: ' Returnvisit.aspx?flag=do ',///commit to which execution
type: ' POS T ',
Success:function () {Alert ($ (' #Tip '). text ());//Show action prompt
};
$ (' #form1 '). Ajaxsubmit (options);
return false;/to not refresh the page, returns false, anyway, it's all done in the background.
});
}
);
</script>