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
https://forums.phpfreaks.com/topic/95058-dynamic-bookmark-properties/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.