Access is denied in the form of submit ()

I am using the jquery form plugin (http://jquery.malsup.com/form), but it does not work in IE 8 and 9. IE denies access to form.submit(); The example on the author’s page is fine, 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'] }); 

This is not a server problem, please do not. No cross domain or other common problems.

+4
source share
1 answer

Here is the fiddle . A simple form of presentation. It works in IE 7, 8 and 9. The thread goes into the error function because test.html does not exist on jsFiddle. But IE was not denied access.

I am using form.submit(); It works great.

I have a problem

Here is the link that resolves your Access Denied problem . JavaScript error while trying to access a document object programmatically created (IE only)

You can see your form plugin log by adding this code.

 $.fn.ajaxSubmit.debug = true; 

Here is the complete 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(); }); 
+1
source

Source: https://habr.com/ru/post/1439980/


All Articles