-1

Can I show a page after finish loading?

1) Open my page.
2) Begin load external page.
3) Open external page through window.location

I need have an event that the page is loaded and without iframe. P.s: page full loaded (DOM and all images).

  • 4
    Possible duplicate of [How can I preload a page using HTML5?](http://stackoverflow.com/questions/7830675/how-can-i-preload-a-page-using-html5) – Dmytro Shevchenko Oct 21 '15 at 12:06

1 Answers1

0

If you are using jQuery, you can do something like this.

// JS
$(function(){

    var external_page =  $('#external_page');

    external_page.ready(function(){

        // This will be executed when the iframe is done loading.
        alert('Page is done loading');

        window.location.href = external_page.attr('src');
    });
});

 <!-- HTML -->
<iframe src="http://api.jquery.com" id="external_page"></iframe>

 /* CSS */
 iframe#external_page {display: none;}
Viktor Sarström
  • 510
  • 4
  • 16