Jump to content

Bookmarking a page


Machiavelli

Recommended Posts

I just use this code, which is really simple to insert:<INPUT TYPE="button" VALUE="Add to Favorites" onClick="addToFavorites()">All you need to do is set the bit in bold to what you want the button to say.
I'll try the simple one first... should it be put in between the HEAD tags or BODY tags? ...
Link to comment
Share on other sites

whats the function for addToFavorites()? You dont specify that so it has no use.
I don't understand it myself personally, I just got it of a website, and it works, so I used it, and when Marchivelli asked about bookmarking I said that this worked. Please can you explain what is wrong with this, and posibly change it?
Link to comment
Share on other sites

This only works for IE as far as I'm aware of.

<a href="java script:window.external.AddFavorite('http://www.yourwebsite.nl','My Website!')">Click here to bookmark this page</a>

The browser needs to support Javascript.Ruud Hermans

Link to comment
Share on other sites

Are you kidding?

<script language="JavaScript" type="Text/Javascript"><!-- // Hide script from older browsers // script by http://www.hypergurl.com var urlAddress = "http://www.hypergurl.com/graphics.html"; var pageName = "Free Graphics,Hypergurl"; function addToFavorites() {   if (window.external) {   	window.external.AddFavorite(urlAddress,pageName)   } else { 	alert("Sorry! Your browser doesn't support this function.");   } } // --></script><a href="java script:addToFavorites()">Bookmark Page!</a>

That's about as simple as it gets, and includes error checking. Make sure to remove the space in "javascript" on the link.

Link to comment
Share on other sites

I should type it out exactly as is or I need to make some changes as well and also where is it placed. Between Head tags or Body tags? etc.
I would copy it exactly by selecting it, then copying and then just change the bits that you need to change as and when you need to, then usually, if the code the person gave you is correct it should all work! :)
Link to comment
Share on other sites

Are you kidding?
<script language="JavaScript" type="Text/Javascript"><!-- // Hide script from older browsers // script by http://www.hypergurl.com var urlAddress = "http://www.hypergurl.com/graphics.html"; var pageName = "Free Graphics,Hypergurl"; function addToFavorites() {   if (window.external) {   	window.external.AddFavorite(urlAddress,pageName)   } else { 	alert("Sorry! Your browser doesn't support this function.");   } } // --></script><a href="java script:addToFavorites()">Bookmark Page!</a>

That's about as simple as it gets, and includes error checking. Make sure to remove the space in "javascript" on the link.

Ok..so i tried the script hypergurl suggested and it's not working... IE says: Page cannot be displayed. so something is wrong with the script or it doesn't work in IE. Only works for other browsers. Doesn't seem to work in Netscape neither. Any ideas? Perhaps there is a error in the script somewhere.
Link to comment
Share on other sites

I would just use the code that I sent to you, it works in IE fines, but not in FF, but does that matter? I don't understand the code that the other person sent, you could just have a look at someone elses source code and then try it in your site?

Link to comment
Share on other sites

Ok..so i tried the script hypergurl suggested and it's not working... IE says: Page cannot be displayed. so something is wrong with the script or it doesn't work in IE. Only works for other browsers. Doesn't seem to work in Netscape neither. Any ideas? Perhaps there is a error in the script somewhere.
Use this link instead with the code I posted earlier.<a href="java script: void(0);" onclick="addToFavorites()">Bookmark Page!</a>The other Javascript code goes in the head of the document. And, like I said before, make sure to remove the space between "java" and "script" in the link, because this forum adds a space there where there should not be one.
Link to comment
Share on other sites

this is another script someone else gave me but doesnt work also... In <head>:<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***********************************************/function bookmarksite(title, url){if (document.all)window.external.AddFavorite(url, title);else if (window.sidebar)window.sidebar.addPanel(title, url, "")}</script>In Body: <a href="java script:bookmarksite('Your Site', 'http://www.yoursite.com')">Bookmark</a>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...