tags:

views:

30

answers:

1

Hi i have the following

    <script type="text/javascript">
    $(document).ready(function () {
        $("#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();
         });
        }); 
    });
    </script>

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

A: 

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>
Phil Jackson