开发者

jQuery form Plugin

开发者 https://www.devze.com 2023-03-23 07:26 出处:网络
I am trying to upload and submit through AJAX a form and I found jQuery.form plugin http://jquery.malsup.com/form/, here is my code :

I am trying to upload and submit through AJAX a form and I found jQuery.form plugin http://jquery.malsup.com/form/, here is my code :

     $("#submitSlide").click(function(){

         var options = { 
            success:    function(data) { 
                console.log(data); 
            },
            error : function( jqXHR , textStatus , errorThrown ){
               console.log( ' broked ' , jqXHR , textStatus , errorThrown );
           } ,
            dataType: 'html',
            type: 'POST',  
            url: 'http://www.slideshare.net/api/1/up开发者_如何学JAVAload_slideshow'
        };

        $('#ssuploadform').ajaxSubmit(options);


         return false;
     });

But I am getting an error like this :

    >>[jquery.form] Server abort: Error: Permission denied to access property 'document' (Error)
    >>[jquery.form] cannot access response document: Error: Permission denied to access property 'document'
    >>[jquery.form] aborting upload... aborted

DO you have any idea how to fix this ?

Thanks, I appreciate any help !


From $.ajax()

Due to browser security restrictions, most "Ajax" requests are subject to the same origin policy; the request can not successfully retrieve data from a different domain, subdomain, or protocol.

You cannot make a cross-origin XHR. See How do I send a cross-domain POST request via JavaScript? for ideas.

0

精彩评论

暂无评论...
验证码 换一张
取 消