PDA

View Full Version : Addbook



pcinfoman
01-20-2006, 06:07 PM
I am using the script found at:
http://www.dynamicdrive.com/dynamicindex9/addbook.htm
And have some questions

Question 1: Is there a way to make this script not load into the sidebar for Netscape/Firefox users?

Question 2: Is there a way to make the script pull the url of the page it is on rather than have it hard coded in the code?

Question 3: Is there a way to have the script pull the title of the page it is on rather than have it hard coded in the code?

This script works great and is by far the best one I have seen.

There is a script at http://www.jscode.com/js_auto_bookmark.shtml the does these things I ask fro, but it only works in IE. I need something that works in IE, Netscape and Firefox. Now, if that is not possible, I need an if/then statement I can use that will use the appropriate working code depending on the browser they are using.

Ideas?
Thanks in Advance.

Twey
01-20-2006, 06:30 PM
Question 1: Is there a way to make this script not load into the sidebar for Netscape/Firefox users?Alas, no.
Question 2: Is there a way to make the script pull the url of the page it is on rather than have it hard coded in the code?Yes, you can get it with window.location.href.
Question 3: Is there a way to have the script pull the title of the page it is on rather than have it hard coded in the code?Use window.document.title here.
Final code:
<a href="javascript:bookmarksite(window.document.title, window.location.href);">Bookmark this page!</a>

pcinfoman
01-20-2006, 06:33 PM
Alas, no
Ouch! Not the reply I had hope for. This is hard to believe tho. Are you saying that there is absolutly no way at all that a "Bookmark This Site" link in javascript can be created that does not load the bookmark in the sidebar? Is this outside the possiblity of javescript? That is difficult to swallow.


Final code:<a href="javascript:bookmarksite(window.document.title, window.location.href);">Bookmark this page!</a>
Awesome! This was perfect. Thank you.

Twey
01-20-2006, 07:02 PM
Is this outside the possiblity of javescript? That is difficult to swallow.I agree, it's stupid. However, insofar as I know, there is no way to do it. I'm sure Mozilla will add this feature in at some point, though. The problem is that the method of bookmarking used for Mozilla-based browsers involves adding a sidebar.

pcinfoman
01-20-2006, 07:05 PM
Hmm, well that sucks. Does this apply to netscape as well? Is there a modification to this code that will work in Netscape without using a sidebar?

pcinfoman
01-20-2006, 07:34 PM
Well, I just posted a message at the Mozilla forums. Lets see what they have to say. I will keep you informed.

Thanks for your help.

Twey
01-20-2006, 07:35 PM
Yes, Netscape is a Mozilla-based browser.
Well, actually, Mozilla is a Netscape-based browser. But everyone has some embarrassing ancestors somewhere. :)