Web Hosting Talk







View Full Version : javeascript that will ask to bookmark a site on exit, if bookmarked already not ask.


thomor25
04-21-2004, 12:47 AM
I want a javascript to ask if the user wants to bookmark the site whenever they leave it and if they already bookmarked it to not ask. I've looked at hotscripts.com and haven't found anything yet and i've googled for it. Does anyone know where I can get such a piece of code?

mshowman
04-21-2004, 01:08 AM
Given browser security functionality, privacy issues, and that different browsers all handle and store favorites differently, it's just not possible. There are also no functions in Javascript to do so specifically since if a browser allowed a java script to view your favorites, that information could potentially be offloaded and used inappropriately.

thomor25
04-21-2004, 01:50 AM
Originally posted by mshowman
Given browser security functionality, privacy issues, and that different browsers all handle and store favorites differently, it's just not possible. There are also no functions in Javascript to do so specifically since if a browser allowed a java script to view your favorites, that information could potentially be offloaded and used inappropriately.

using a cookie i think not. www.jensicons.com uses it and I want to use it on mine. One that is close to mine but doesn't work on exit and works differently is this here http://simplythebest.net/scripts/DHTML_scripts/javascripts/javascript_44.html so I proved that it is possible 2 times. I don't want to annoy them if they already bookmarked it by using a cookie. I want it on exit tho not on enter.

mshowman
04-21-2004, 03:18 AM
The trouble with that is the javascript "AddFavorite" function does not send any feedback to the script as to whether or not you actually did set it as a bookmark. All you can do is set a cookie to have the script not prompt you to set it as a bookmark if it has already prompted you. There is no way I know of to let the script know if you did set it as a favorite or not.