Home >Web Front-end >JS Tutorial >Some very practical and must-use small script codes Page 1/5_javascript skills

Some very practical and must-use small script codes Page 1/5_javascript skills

PHP中文网
PHP中文网Original
2016-05-16 19:27:181060browse

Script 1: Automatically play the sound after entering the homepage
Script 2: Enter Automatically maximize the words after the home page, saving you the need to click yourself
<script> <br>self.moveTo(0,0) </script>

Script 3: Display the current time



Script 4: Display Script for the last modified time

<script>document.write(document.lastModified)</script>

Script 5: Set as homepage, add as favorites, join channel, start outlook Send a message

onclick="this.style.behavior="url(#default#homepage)";
this.setHomePage(http:/ /www.php.cn/);">">Set as homepage


onclick="window.external.AddFavorite (location.href,document.title);">Add to favorites

Add channel< ;/a>
Contact me

Script 6: Status bar dynamically displays the current time


<script> <br>function see(){ <br>window.setTimeout("see()",1000); <br>today = new Date(); <br>self.status = today.toString() ; <br>} <br></script>



Script 7: Script to close the window


[Close window]

Script 8: Press the F12 key to return directly to the homepage


< script>function look(){
if(event.keyCode==123){document.location.href=http://www.php.cn/~kayvin/}
}
if(document .onkeydown==null)
{document.onkeydown=look}



Script 9: Back, Refresh, Forward









Script 10: Set time pop-up window, 4000=4 seconds, of course you can customize it


<script>function l() <br>{ <br>window.open(" 10.13.31.90/~kayvin/ ","name","width=500,height=150, border=0") <br>} <br>setTimeout("l()",4000) <br><br></script>


Current page 1/5

1

2345Read the full text on the next page

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