The 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 Add to Favorites link. There are a
few simple characteristics that you should take note of:
The code I mentioned above
works on any page and requires very little customization.
The code will automatically determine the title of your page
and the correct URL with no input required from you. There
are, however, times when you do not want to have the current
page's title and location added to your favorites. You may
want to specify a specific page title and URL instead.
For such situations, use the following code
instead:
javascript:window.external.AddFavorite('http://www.kirupa.com',
'kirupa.com')
The above code is very similar to the code posted earlier.
The only difference is that the location.href and
document.title parameters have been replaced with actual
values that are independent of the page you are currently
in.
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: