4

Im using jquery form plugin (http://jquery.malsup.com/form) and on IE 8 and 9 its not working. IE denies access to form.submit(); Example on author page is ok, my not. Do I need additional configuration for IE?

$(parent + ' form').ajaxForm({
    success: function(data) {
        $("#cont").html(data);
    },
    beforeSubmit: function(arr, f, o) {
        o.dataType = "html";
    },
    iframeSrc: urlTab['upload']
});

It's not a server issue, request it not made. No cross domain and other common problems.

Peter O.
  • 32,158
  • 14
  • 82
  • 96
WombaT
  • 790
  • 1
  • 13
  • 27

1 Answers1

1

Here is Fiddle. Simple form submission. It works in IE 7, 8 and 9. Flow goes to error function because test.html does not exist on jsFiddle. But No access denies error occurred on IE.

I am using form.submit(); it works fine.

I got your problem

Here is a link which resolves your problem “Access is denied” JavaScript error when trying to access the document object of a programmatically-created (IE-only)

You can see your logs of forms plugin by adding this code.

$.fn.ajaxSubmit.debug = true;

Here is Full COde

$.fn.ajaxSubmit.debug = true;

$(document).ajaxError(function(ev,xhr,o,err) {
    alert(err);
    if (window.console && window.console.log) console.log(err);
});

$('form').ajaxForm({
    dataType:'html',
    iframe:true,
    iframeSrc : "javascript:'<html><body><p>Hello<\/p><script>do things;<\/script>'",
    success: function(data) {

    },
    beforeSubmit: function(arr, f, o) {

    },
    error: function(responseText){
        alert(responseText.status+'  ::  '+responseText.statusText);
    }
});
$('#submitBtn').click(function(){
    $('form').submit();
});
Community
  • 1
  • 1
Zahid Riaz
  • 2,879
  • 3
  • 27
  • 38