You are here:   Home > Scripts > Bookmark page HTML
What's
New
Doll
Makers
Room
Makers
Puzzle
Makers
Roiworld Stardoll Smilies Links

Back to Scripts

Tutorial, How to Bookmark webpage in HTML



Creating a simple "Bookmark this webpage" link.

The html script that sets the homepage only works for IE. It calls the following function, "this.setHomePage('http://someurl.com')" (see below) <a style="cursor:hand" onclick="this.style.behavior='url(#default#homepage)'; this.setHomePage('http://elouai.com/bookmark-favorites.php');"> <img width=16 height=16 border=0 src="images/house.png"> <u> Set as Home Page</u></a> The script "Set Homepage" outputs:
Set this as your Home Page

There are 4 HTML elements:
  1. style="cursor:hand" - changes the cursor to be a hand when over this html link.
  2. onclick="this.style.behaviour='url(#default#homepage)';this.setHomePage('http://elouai.com/bookmark-favorites.php');" - on the mouse click call the home page dialog, setting the home page to http://elouai.com/bookmark-favorites.php.
  3. <img width=16 height=16 border=0 src="images/house.png"> - We set the image to a recognizable icon, one used by IE since 96% of the web uses IE. Border 0 to hide the outline that it is clickable.
  4. Set as homepage - Text to display.


Let's extend this example and dynamically (using PHP), fill in the current page for us. This way we can re-use the same script on any webpage without having to edit the parameter for "this.setHomepage".

..this.setHomePage('<?php echo $_SERVER['DOCUMENT_ROOT'];?>')..

The output:
Set this as your Home Page
references:
MSDN: HOW TO Set the Default Home Page
Predefined Variables




About     Privacy Policy     Hosting by Web Hosting Canada

Except where otherwise noted, this site is licensed under a Creative Commons License



contact us: elouai@gmail.com
©2003-2022 eLouai.com, All rights reserved