Jump to content

Dynamic bookmark properties


Voodoo Jai

Recommended Posts

I want to place a book mark this page code on my site that takes the Href directly from the location bar of the browser. All I can find is ones that have the href details already hardcoded into the page. I want to take the pages url parameters into account which change with every page so that the correct dynamic page loads. The following is the code I found.

 

<script type="text/javascript">

function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
</script>

href attribute use this code

javascript:bookmarksite('title_of_site', 'url_of_site')

Example:
<a href="javascript:bookmarksite('Sitename', 'http://www.domain.com')">Bookmark this site!</a>

 

Hope U can help again

Many thanks in advance

VoodooJai

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.