Common web Effects JS code

Source: Internet
Author: User

Collect this site

<span style= "Cursor:hand" onclick= "Window.external.addFavorite" (', ' Programming starter network ') "title=" Programming Portal "> Favorites Site </span>
Or:
<script language= "JavaScript" >
function Bookmarkit ()
{
Window.external.addFavorite (' http://your url ', ' Your site name ')
}
if (document.all) document.write (' <a href= "#" onclick= "Bookmarkit ()" > Add Favorites </a> ")
</Script>

Universal Favorites

<script type= "Text/javascript" >
<! [cdata[
function Bookmark () {
var title=document.title
var url=document.location.href
if (Window.sidebar) window.sidebar.addPanel (title, URL, "");
else if (Window.opera && window.print) {
var MBM = document.createelement (' a ');
Mbm.setattribute (' rel ', ' sidebar ');
Mbm.setattribute (' href ', url);
Mbm.setattribute (' title ', title);
Mbm.click ();}
else if (document.all) window.external.AddFavorite (URL, title);
}
]]>
</script>

<a href= "Javascript:bookmark ()" > Add Favorites </a>

In Ie6-7. FF2.0 OP9.0 Test Pass

Set as homepage

<span onclick= "var strhref=window.location.href;this.style.behavior= ' url (#default #homepage) '; this.sethomepage ('');" style= "Cursor:hand" > Set homepage </span>

Back to the top of the page

Open in the original window

onclick= "location.href= ';" style= "cursor:pointer;"

Open in New window

onclick= "location.href="; "style=" cursor:pointer;

Forward

<input name=submit onclick=history.go (1) type=submit value= forward >

Back off

<input name=submit2 onclick=history.go ( -1) type=submit value= back >

Close the current window

<a href= "/" onclick= "Javascript:window.close (); return false;" > Close Window </a>

Print

<input Name=button ONCLICK=DOCUMENT.ALL.WEBBROWSER.EXECWB (6,1) Type=button value= print ><object Classid=CLSID : 8856F961-340A-11D0-A96B-00C04FD705A2 height=0 Id=webbrowser width=0></object>

Highlighted rows

Onmouseout= "this.bgcolor="; this.style.color= ' #000 ' "onmouseover=" this.bgcolor= ' highlight '; This.style.color= ' FFF ' "

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.