Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Adding a popup window?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Jeff V
Starting Member

23 Posts

Posted - 29 September 2003 :  22:42:03  Show Profile
I have a webpage called popup.htm Is there a way to add this popup window that will popup when someone first enters the forum for special notices? Needs to set a cookie not to popup again until the person leaves the forum and returns.

I know how to do it on a htm style web page and works great. Not sure about doing it on an ASP.

Jeff

Edited by - Jeff V on 29 September 2003 22:42:27

dayve
Forum Moderator

USA
5820 Posts

Posted - 29 September 2003 :  22:47:11  Show Profile  Visit dayve's Homepage
down and dirty psuedo'ish...


<% 
  if Request.Cookies("myPopup") <> "Y" then
  Response.Cookies("myPopup") = "Y"
%>
popup window code here
<% end if %>


Go to Top of Page

Jeff V
Starting Member

23 Posts

Posted - 30 September 2003 :  08:21:06  Show Profile
Thanks, where do I put it? The page name I want to show is popup.htm Can you show me how to include this in the code above?

This is the script I use on an htm style page.

<script>

//Popup Window Script
//By JavaScript Kit (http://javascriptkit.com)
//JavaScript tutorials and over 400+ free scripts

function openpopup(){
var popurl="http://www.atvoffroad.net/popup.htm"
winpops=window.open(popurl,"","width=400,height=250,")
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function loadornot(){
if (get_cookie('poppedup')==''){
openpopup()
document.cookie="poppedup=yes"
}
}

loadornot()
</script>



Thanks,
Jeff

Edited by - Jeff V on 30 September 2003 08:24:42
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 30 September 2003 :  10:17:43  Show Profile  Visit dayve's Homepage
your code already has a cookie routine in it (in javascript) which should work just fine. You will not need any further modifications.

Go to Top of Page

Jeff V
Starting Member

23 Posts

Posted - 02 October 2003 :  20:10:57  Show Profile
Thanks for the replies, but what file do I place this in and where would it go?

Jeff
Go to Top of Page

Dave.
Senior Member

USA
1037 Posts

Posted - 02 October 2003 :  20:39:55  Show Profile
In inc_header.asp and put it near the other Javascripts.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07