Common JavaScript statement sets (1)

Source: Internet
Author: User

--------------- Output and backward

<Script language = "JavaScript">
Alert ("error ~~ Enter an account !! ");
Location. href = "javascript: history. Back ()"
</SCRIPT>

 

 

--------------- Output and redirect

<Script language = "JavaScript">
Alert ("added successfully ~~!! ");
Location. href = "Booklist. asp"
</SCRIPT>

 

 

---------------- Embed a page and set it to editable

<Script language = "JavaScript">
Document. Write ('<IFRAME src = "text. asp" id = "message" width = "550" Height = "250"> </iframe> ')
Frames.message.doc ument. designMode = "on ";
</SCRIPT>

 

 

--------------- Check whether the check box is selected and prompt

<Script language = "JavaScript">
Function checkdata ()
{
If (document. form1.viewhtml. Checked = true)
{
Alert ("sorry, please cancel" view HTML source code "and add it again! ")
Document. form1.viewhtml. Focus ()
Return false
}
}
</SCRIPT>

 

 

---------------- Use JavaScript to open a new window (controllable size) in hyperconnections)

<A href = # onclick = "javascript: window. Open ('buy. asp? Id = <% = RS ("ID") %> ', '', 'width = 570, Height = 160, toolbar = No, status = No, menubar = No, resizable = Yes, scrollbars = Yes '); Return false; "> open a window </a>

 

 

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.