954,598 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Bookmark when closing browser.

I am looking for a script that will promt the user to bookmark my site when they try to close the browser. I have seen them in the past I cant seem to find one now that I need it.

raywood5
Newbie Poster
10 posts since Jan 2005
Reputation Points: 10
Solved Threads: 1
 

I know a javascript code which will prompt the user to bookmark your page:

You will need to change the following to your own details

var url="ENTER YOUR WEBSITE ADDRESS HERE";
var title="ENTER A TITLE FOR YOUR SITE HERE";

Here's the code:

I also know that you can make something happen when the page is closed using:

I also know that if you save your javascript as a .js file using notepad (take out the if you do this though) you can use:

That's all I know, hope someone else knows the rest.

Martin

martinkorner
Junior Poster
102 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

By the time the onunload triggers the person is no longer on your page to be able to bookmark it.

felgall
Junior Poster in Training
50 posts since Aug 2004
Reputation Points: 13
Solved Threads: 1
 

You could have a pop-up window with that link on it which will bookmark your page when clicked, but this window will be blocked if the user has a pop-up blocker installed - which most people will.

Unless someone knows how to make a pop-up window which will not be blocked, then the only other way is probably to put a link on your homepage using the above script again.

Martin

martinkorner
Junior Poster
102 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You