This post mainly collects various introductory codes
Hiding and displaying layers
Just set the display attribute of style
For example,
Hidden layer
If you want to display it, you can control it through script
window.document.getElementById("MyDiv").style.display = "";
Disable right click Program running error in shielding page Information window.onerror = function()
{
return true;
}
Get the resolution of the current monitor window.srceen.width gets the width of the screen
window.srceen.height gets the height of the screen
If the current resolution is 800*600, window.srceen.width is 800, window.srceen. height is 600
Run specific code regularly setTimeout(Code,Timeout);
setInterval(Code,Timeout);
Code is a string , inside is the js code, Timeout is the time interval, the unit is microseconds
setTimeout is how many microseconds from now to run the code (only runs once)
setInterval is how many microseconds to run the code
Get the URL of this page var Url = window.location.href;
Save the content of the current page document.execCommand("SaveAs","","C:\index.htm");
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn