Summarize common JS Functions

Source: Internet
Author: User
I have been connected to three programming languages, PHP, Shell, and JS, for more than two months. I have found that there are commonalities between languages, but there are also differences. So we need to sum up commonalities, focus on learning the non-commonalities between languages. The same language should be summarized in more ways to get twice the result with half the effort. Below we will summarize JS... SyntaxHighlighter. all ();

I have been connected to three programming languages, PHP, Shell, and JS, for more than two months. I have found that there are commonalities between languages, but there are also differences. So we need to sum up commonalities, focus on learning the non-commonalities between languages.
The same language should be summarized in more ways to get twice the result with half the effort. Below we will summarize the common functions of JS:

Move back to www.2cto.com

Return

View Source Code

Prohibit source code viewing

Refresh button 1

Script function ReloadButton () {location. href = "i001.htm";} script

Refresh button 2

Home page button

Script function HomeButton () {location. href = http://www.yourname.com/?##script》

Background Color Conversion

Script function BgButton (){
If (document. bgColor = '# 00ffff ')
{Document. bgColor = '# ffff ';}
Else {document. bgColor = '# 00ffff ';}
}
Script

Open new window

Script function NewWindow () {window. open ("c01.htm", "", "height = 240, width = 340, status = no, location = no, toolbar = no, directories = no, menubar = no ");}
Script

Minimize windows
<PARAM name = "Command" value = "Minimize"><Button onClick = "min. Click ()"> minimized window

Full Screen code

Close Window
<Param name = "Command" value = "Close"><Input type = "button" value = "Close Window" onClick = "closes. Click ();">

Close Window

Maximize


Link button 1

Link button 2

Link button 3

The source code is displayed in the warning box.
The source code is displayed in the warning box.

Click to clear

Print

Print preview

Save

Click auto copy
Script function ocopy(obj1_1_obj.select(1_1_js1_obj.createtextrange(1_1_js.exe cCommand ("Copy")} script

Automatically Selected

Open source code
Open source code

Delayed opening of new window

Implement the First Half of the selected text box

Click Clear Text

Click Clear Text

Equal to title ):

Script document. getElementById ("aa"). value = document. title; script

Check whether IE is offline

11 methods for refreshing buttons











Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.