我正在创建一个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>
任何想法,为什么发生这种情况?
在此先感谢。
你有没有找到这个解决方案?我有同样的问题。 – ari 2012-05-09 22:01:23
我做了一些变通方法,仍然试图记住他们发布解决方案。请在您的应用基本设置中添加正确的应用程序域,并提供反馈。 – CrisDeBlonde 2012-05-09 22:57:35
你是怎么解决这个问题的?我也有这个问题。 – PinoyStackOverflower 2012-11-26 08:04:52