PDA

View Full Version : Bookmark Site script and Chrome?



newbi462
06-03-2011, 01:29 PM
1) Script Name: Bookmark Site script:

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex9/addbook.htm

3) Describe problem:

Ok it works in FF but not in Chrome. Is there a way to tweak this scrip to make it work correctly with Chrome? or if not add a test that will hide it in Chrome? am already using jQuery so can just use .hide but would prefer if it can be that the book mark link works in Chrome

Head is:

<script type="text/javascript">

/***********************************************
* Bookmark site script- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
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>

Body is:

<a href="javascript: bookmarksite(document.title, window.location.href)">Bookmark Page</a>

I see from the code this has been re done to support FF, Opera, and IE. Hope some one knows what additional else if needs to be added for Chrome, or if not can help me add an else if to hide the link for Chrome

.......


Another problem when you use the book mark it creates in FF4 it does not load the page in stead it open a window on the side next to the current page. is there a way to ttweek it so the book marked page open as a normal bookmark as it should?



Thanks in advance

jscheuer1
06-04-2011, 12:26 PM
Try the bookmark button here (upper right):

http://molendijk.110mb.com/dynamic/index.html

As mentioned here:

http://www.dynamicdrive.com/forums/showpost.php?p=114468&postcount=26