View Single Post
  #1 (permalink)  
Old Aug 12th, 2007, 08:28
JewelEnterprises JewelEnterprises is offline
Junior Member
Join Date: Aug 2007
Location: Australia
Age: 42
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Question help needed with Javascript

Hi

My name is Julia Andersson. I'm creating a new business website and need some help with javascript.

What I am wanting to do is have my site pop up a message when a person leaves asking them if they want to navigate away from the page or stay and join my mailing list. but I'd also like to know if it is possible to have one of those checkboxes on it allowing regular visitors to turn it off. (keeping in mind the 20/80 rule that 20% of customers provide 80% of sales... I really don't want to be annoying those ppl with the pop up... if that's what you call it)

I have used something similar on another site as a warning prior to them visiting a certain page and the script I used was
Code: Select all
<script language=javascript><!--
function checkDoD(){if (!confirm
("You are entering a restricted area of adult content. click OK if you are of legal age and want to view my delicate material. click CANCEL if you are underage or if viewing sexual content is *strictly illegal* in your country ; )"))
history.go(-1);return " "}
document.writeln(checkDoD())<!--End--></script>
I don't know how similar the script would be but that one doesn't include the facility to turn it off and that one was at the top of the new page... the one I want would have to be on the page I want it to pop up on (probably at the bottom as the last piece of code to execute) and I'm not sure what the command would be for when someone leaves (either by closing the tab/window, clicking a link in favourites or typing in a new url to visit, all of those would need to be covered.) The only one it doesn't need to pop up on is when a person clicks an internal link as the mailing list form appears on the sidebar of every page.

Could somebody please help me with this.

Thank you

Julia

Last edited by karinne; Aug 13th, 2007 at 12:24. Reason: Please use [ code ]...[ /code ] tags when displaying code. It's easier to discern code from content ;)
Reply With Quote