Voodoo Jai Posted March 8, 2008 Share Posted March 8, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.