ajaxSubmit and Internet explorer issue

I'm stuck for quite some time with this, could someone help me out ? Everything is working fine with Chrome and FF, but for some reason the form won't submit with IE7/IE8/IE9.

function addFile()
{
if ( test > 30 ) { console.log( "addFile" ) ; }

var optionsAjaxFormFile = { 
    url : 'js/fileUpload.php',
    success : showResponseFile
}; 

console.log("about to submit Ajax");
$("#addFile-form").ajaxSubmit( optionsAjaxFormFile );   
}

I know from the Console it goes to the ajaxSubmit line, but it never starts the showResponseFile function. Why ???

Cheers

Answers:

Answer

Not sure but you can try with this:

$(document).ready(function() { 
   $("#addFile-form").submit(function(){
      $(this).ajaxSubmit(optionsAjaxFormFile);
      return false; 
   });
});
Answer

console is only defined in IE9 when its DOM inspector is open, replace console.log() with

if(typeof(console)!='undefined'){
 console.log("about to submit Ajax");
}

or you can use the good old alert

Answer

In between the head tag add

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" >

you will also need to close and open IE again for the meta tag to work

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.