我有一個頁面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