Flash Components      Flash Menu      Flash Gallery      Flash Slideshow      FLV Player      Flash Form      MP3 Player      PhotoFlow      Flash CMS      3D Wall      Flash Scroller

Flash / AS

Silverlight

WPF

ASP.net / PHP

Photoshop

Forums

Blog

About

 


FlashComponents
  Galleries
  Slideshows
  Menus
  Design & Effects
  Audio & Video
  User Interface
  Templates

 

 

 

 

 
Set
Home Page Link
         by kirupa chinnathambi

What would be cooler than having someone set your site as their home page? Before you gaze starry eyed toward the future, let's hope you know how to create a home page link. A homepage link is a link, when clicked, that prompts the visitor with the option of setting your page as their home page.

For an example of what I am referring to, click the following button:

The Code:
T
he simplest way of implementing the JavaScript code would be to include it in a hyperlink. Copy and paste the following code into Notepad or your HTML editor and preview the page in your browser:

Basically, if you know how to create a hyperlink to a different page, you will be able to create a Set Homepage link. There is one characteristic that you should take note of:

  • window.location.href
    This parameter gets the full URL of the current page. If you want to set the home page of a specific URL, change window.location.href to the actual URL such as "http://www.kirupa.com" - with the quotation marks:

document.body.setHomePage("http://www.kirupa.com");

Just remember to copy the function - the chunk of code beginning with function setHome(), and do not forget to hyperlink to your function setHome() with the javascript: identifier before it.

I hope the information helped. If you have any questions or comments, please don't hesitate to post them on the kirupa.com Forums. Just post your question and I, or our friendly forum helpers, will help answer it.

The following is a list of related tutorial and help resources that you may find useful:

How to use the Forums
New, Upcoming, and In-Progress Tutorials
How to Help out kirupa.com
Writing Tutorials
 
Cheers!
Kirupa Chinnathambi
kirupaBlog

 


kirupa.com's fast and reliable hosting provided by Media Temple. flash components
The Text Animation Component for Flash CS3
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.
Check out our high quality vector-based design packs! Flash Effect Components

Flash Templates
CSS Templates
Dreamweaver Templates

flash menus, buttons and components
Digicrafts Components The best flash components ever!
Entheos Flash Website Templates Buy and sell FLAs at Ultrashock!
Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com Purchase & Download Flash Components
flash components  Learn how to advertise on kirupa.com