How to stop page load in html static page

后端 未结 11 1299
庸人自扰
庸人自扰 2020-11-30 02:35

Is there in HTML (javascript) or other static html tech can:

  • Stop page loading (if browser does not download yet)
  • Stop page rendering (from where the
相关标签:
11条回答
  • 2020-11-30 02:51

    Well, there is: <!-- terminated by --> for HTML, but scripts will ignore this.

    0 讨论(0)
  • 2020-11-30 02:58

    You could also hide the body like that:

    var style = document.createElement("style");
    style.innerHTML="body { display:none !important; }";
    document.getElementsByTagName("HEAD")[0].appendChild(style);
    
    0 讨论(0)
  • 2020-11-30 02:59

    HTML is static content so the server reads whatever you have written in the file unless you comment it out. For a dynamic file like what you are asking for you need to use php which can do this type of thing.

    0 讨论(0)
  • 2020-11-30 03:00

    Just not much related to the question, but I thought it may be useful for some persons. If you want to jump to other page during page loading use window.location = "somepage.html"; or you can redirect users to the previous page: window.history.go(-1); Useful in JavaScript conditional statements

    0 讨论(0)
  • 2020-11-30 03:04
    window.stop(); //works in all browsers but IE    
    if ($.browser.msie) {document.execCommand("Stop");}; //works in IE, 
    

    document.execCommand works in IE, however it does stop some of FF, NS and some other browsers' functions. Like displaying GIF's animation for example. Using "if browser is IE" makes these two codes work perfectly in all browsers.

    0 讨论(0)
  • 2020-11-30 03:04

    put window.Stop() wherever you want to stop the page from getting renderred

    0 讨论(0)
提交回复
热议问题