我有一个页面index.php 在index.php我加载到index.php与AJAX的另一个页面(new_case_form.php)到我的div女巫有这样的“出”ID。Ajax包含文件
function new_case(){
if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("out").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","new_case_form.php",true);
xmlhttp.send();
}
在我的new_case_form.php文件中,我包含一个上传文件,但它不起作用。
如果我只是直接在我的web浏览器中加载new_case_form.php而不通过index.php,它就可以正常工作。但是,如果我从index.php调用ajax页面,那么它将无法正常工作。
任何想法为什么?
我不知道你是否回答这样的问题,但我真的需要得到这个工作。我还没有发现任何其他与此问题。也许我谷歌错了:)
上传脚本是从http://blueimp.github.io/jQuery-File-Upload/
有一个愉快的一天。
最佳瑞典
问候
可能重复http://stackoverflow.com/questions/1197575/can-scripts-be-inserted-with- innerhtml) – Quentin