效果很好但是一旦iframe被删除,主页面就会继续加载。知道为什么以及如何终止加载?
答案 0 :(得分:0)
认为这样可行,但没有
<script type="text/javascript">
$(document).ready(function () {
window.name = "main";
$("#uploadSubmit").bind("click", function () {
//edit below to suit
var src = "uploader.php";
//end
var results = '<iframe src="' + src + '" name="uploader" id="uploaderIframe"></iframe>';
$("#uploader").append(results);
$("#uploadResult").html('Uploading please wait... <img src="images/loader.gif" />');
$("#uploaderIframe").load(function () {
var iframeHtml = $('#uploaderIframe').contents().find("body").html();
$("#uploadResult").html(iframeHtml);
$("#uploaderIframe").remove();
main.execCommand('Stop');
main.stop();
});
});
});
</script>