Jump to content

[SOLVED] Why isn't this working?


ballhogjoni

Recommended Posts

The code below is supposed to run when the user tries to leave the page. It works if the user clicks their home page button, but if they try to exit the page or refresh the page it doesn't work.

 

<script language="javascript">
var occured="no";
function ucantgoyet() {
if (occured == "no") {
	if (confirm("WAIT! We hate to see you go without trying the eBay Auction Success Toolkit. So, just this once we'd like to offer you our top selling money making eBay Success Kit for $1.00 if you'll change your mind right now.\n\nThat's over $894 in value for the small investment of just $1.00.\n\nIt's a great value! Click OK to get started")) {
document.location.href = "https://realfinancialsuccess.com/secure/ebaysuccesskit/index3.php";
	} else {
		if (confirm("Are you sure you don't want to begin your eBay business and remove yourself from the same old 9-5 routine? You are getting a tremendous oppurtunity and deal. \n\nIts just $1.00 and you can begin your money making quest on eBay.\n\nRemember you get a 200% MONEY BACK Guarantee, if you don't receive the results you want, we will pay $3.90 (double your money).\n\nYou will kick yourself if you miss the oppurtunity! Click OK to get started")) {
document.location.href = "https://realfinancialsuccess.com/secure/ebaysuccesskit/index3.php";
	       } else {

	       }
	}
}
}
</script>

Link to comment
Share on other sites

No this is a completly different question. The code works just fine until the user wants to close the page or refresh the page. Basically, if the user clicks the close button on their browser, the script will run, but when they click ok the browser closes. It should redirect them to the url listed. Same thing when you refresh the page.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.