8
不工作4小时阅读帖子后,试图解决这个问题.....jQuery的形式插件的IE 8
我使用该插件上传照片,并返回到TinyMCE的编辑器。它适用于Chrome和Firefox,但在IE中失败。在开发工具中,由于IE无法识别finally
语句,因此它在474行的jquery.forms.js中断。所以我删除它,然后我收到访问被拒绝,当相同的文件调用form.submit()
。不管我不能解决这个问题。我正在使用Jquery v. 1.8.1
和Malsup Jquery Form Plugin v. 3.15
。
下面是代码:
$("#img-form").hide(); // hide the browse button
$("#image").change(function() {
$("#img-form").ajaxSubmit(options); // upload the file directly after selection
});
/*
* set options for jQuery form plugin
*/
var options = {
cache: false,
contentType:"text/html",
type: 'POST',
url: "../upload.php",
data: { width: w, height: h, bounds: b },
success: showResponse // post-submit callback
};
function showResponse(responseText, statusText, xhr, $form) {
var obj = JSON.parse(responseText);
var state = obj.state;
var response = obj.response;
if(state) {
tinyMCE.execCommand('mceInsertContent', false, response); // place the image into the editor
} else {
alert(response);
}
}
任何帮助都,你会救我的理智,谢谢!