开发者

page keeps on posting to iframe when removed

$(document).ready(function () { $("#uploadSubmit").bind("click", function () { //edit below to suit var src = "uploader.php"; //end var results = ''; $("#uploader").append(results); $("#uploadResult").html('Uploading please wait... '); $("#uploaderIframe").load(function () { var iframeHtml = $('#uploaderIframe').contents().find("body").html(); $("#uploadResult").html(iframeHtml); $("#uploaderIfr开发者_开发技巧ame").remove(); }); }); });

works perfectly but the main page keeps loading once the iframe is removed. Any know why and how i can terminate the loading?


thought this would work but didn't

<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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜