2012-01-10 71 views
2

我正在创建一个Facebook应用程序,并且想要使用jquery form plugin实现类似Ajax的图片上传。一切都OK了镀铬/ FF但在IEXPLORER我得到如下因素的错误:Ajax表单 - 图片上传|访问被拒绝在ie

Message: Access Denied 
Line: 349 
Char: 5 
Code: 0 
URI: http://application.my_domain.gr/apps/new_app/js/jquery.form.js 

我知道的跨域问题,但不明白为什么会这样,因为所有的脚本,我正在使用curently在同一个域上。
下面是我如何做它在Firefox/Chrome的工作:

<html> 
<head> 
    <script type="text/javascript" src="js/jquery.js"></script> 
    <script type="text/javascript" src="js/jquery.form.js"></script> 
</head> 
<body> 

<form id="imageform" method="post" enctype="multipart/form-data" action='ajaximage.php'> 
     <input type="file" name="photoimg" id="photoimg" /> 
</form> 
<div id='preview'> 
</div> 

<script> 
$('#photoimg').bind('change', function() { 
        $("#preview").html(''); 
        $("#preview").html('<img src="img/loader.gif" alt="Upload in progress"/>'); 
        $("#imageform").ajaxForm({ 
             target: '#preview', 
             success: function() { 
               $("#preview img").attr("id", "uploaded_img"); 
             } 
        }).submit(); 


      }); 
</script> 
</body> 
</html> 

任何想法,为什么发生这种情况?
在此先感谢。

+0

你有没有找到这个解决方案?我有同样的问题。 – ari 2012-05-09 22:01:23

+1

我做了一些变通方法,仍然试图记住他们发布解决方案。请在您的应用基本设置中添加正确的应用程序域,并提供反馈。 – CrisDeBlonde 2012-05-09 22:57:35

+0

你是怎么解决这个问题的?我也有这个问题。 – PinoyStackOverflower 2012-11-26 08:04:52

回答

0

OK,这是因为我张贴的问题一段时间,但这里是终于为我工作:

我只是说我在应用程序的基本设置(基本信息部分)域“应用程序域”和everething工作好!

-1

如果您正在从安全页面(https) 到非安全页面或副版本进行ajax调用,IE将显示错误。

确保所有的url,页面url和ajax url都具有相同的安全性。

+0

感谢您的回复。所有的url都有相同的安全性:s – CrisDeBlonde 2012-01-10 22:25:15