473,473 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

popup box 1 time in session

I have a page where users upload pics of there own
I want it to have a popup box that tells them I have now control of the following content
If they hit ok the page loads if the hit cancel or no the page goes to my homepage, aany help or is this even possible?
Thanks you
Jul 23 '05 #1
6 1723
I have this code which does about 90% of what i want

<script>
//specify message to alert
var alertmessage="adult 18+ images! \n We are not responsible for the
content in this section."
//Alert only once per browser session (0=no, 1=yes)
var once_per_session=1
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(off set, end))
}
}
return returnvalue;
}
function alertornot(){
if (get_cookie('alerted')==''){
loadalert()
document.cookie="alerted=yes"
}
}
function loadalert(){
alert(alertmessage)
}
if (once_per_session==0)
loadalert()
else
alertornot()
</script>

----------------------------------

all this code is missing is a Yes or No option
"aznFETISH" <ne**@aznfetish.com> wrote in message
news:J2******************@tornado.tampabay.rr.com. ..
I have a page where users upload pics of there own
I want it to have a popup box that tells them I have now control of the
following content
If they hit ok the page loads if the hit cancel or no the page goes to my
homepage, aany help or is this even possible?
Thanks you
Jul 23 '05 #2
In article <Vu******************@tornado.tampabay.rr.com>, ne**@aznfetish.com
enlightened us with...

all this code is missing is a Yes or No option


Change alert to confirm and stick in an IF.

if (confirm(message))
{
// do something
}
else
{
// do something else
}
--
--
~kaeli~
Is it true that cannibals don't eat clowns because they
taste funny?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3
That makes sense but Im still a bit lost new to this javascript

"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <Vu******************@tornado.tampabay.rr.com>,
ne**@aznfetish.com
enlightened us with...

all this code is missing is a Yes or No option


Change alert to confirm and stick in an IF.

if (confirm(message))
{
// do something
}
else
{
// do something else
}
--
--
~kaeli~
Is it true that cannibals don't eat clowns because they
taste funny?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4
In article <KP******************@tornado.tampabay.rr.com>, ne**@aznfetish.com
enlightened us with...
That makes sense but Im still a bit lost new to this javascript


Someone else wrote your other script, too, eh? ;)

Assumes: this function is being loaded in a popup window with the opener as
the page in question. If this is NOT the case and the alert is running right
in the main window, change the word "opener" to the word "window" (no
quotes). I wasn't sure what you meant by 'popup a box'.

function loadalert()
{
if (!confirm(alertmessage))
{
// they cancelled: go back to home page
opener.location.href = "yourHomePage.html";
}
else
{
// load content into opener
opener.location.href="theAdultContent.html";
}
}
--
--
~kaeli~
If a turtle doesn't have a shell, is he homeless or naked?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #5
Hi yes I found the script on the web that I posted,
What I need is a popup box as in the litle alert box to load when I go to
the page for the first time in that session. The script I posted does that
but has 1 option an "ok" option I want to have like a Yes or NO option and
if no is hit go back if yes the continue to load that page
Thanks for your help

"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <KP******************@tornado.tampabay.rr.com>,
ne**@aznfetish.com
enlightened us with...
That makes sense but Im still a bit lost new to this javascript


Someone else wrote your other script, too, eh? ;)

Assumes: this function is being loaded in a popup window with the opener
as
the page in question. If this is NOT the case and the alert is running
right
in the main window, change the word "opener" to the word "window" (no
quotes). I wasn't sure what you meant by 'popup a box'.

function loadalert()
{
if (!confirm(alertmessage))
{
// they cancelled: go back to home page
opener.location.href = "yourHomePage.html";
}
else
{
// load content into opener
opener.location.href="theAdultContent.html";
}
}
--
--
~kaeli~
If a turtle doesn't have a shell, is he homeless or naked?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #6
In article <3G******************@tornado.tampabay.rr.com>, ne**@aznfetish.com
enlightened us with...
Hi yes I found the script on the web that I posted,
What I need is a popup box as in the litle alert box to load when I go to
the page for the first time in that session. The script I posted does that
but has 1 option an "ok" option I want to have like a Yes or NO option and
if no is hit go back if yes the continue to load that page
Thanks for your help


I posted the solution. Replace the function as noted.
--
--
~kaeli~
If the funeral procession is at night, do folks drive with
their lights off?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Jimmy Junatas | last post by:
When we open a window (using client-side jscript ie. window.open("/Site/Popup.aspx?...",...)) from Page1.aspx, the called page Popup.aspx does not have access to the Session variables present in...
2
by: Joe Molloy | last post by:
Hi, This isn't a mission critical question but I thought I'dl throw it out there for your feedback as it's a bit curious. I have developed a shopping cart for an application I'm working on...
0
by: ChrisB | last post by:
I'm attempting to open a new window from a LinkButton in a DataGrid. I can set a session variable in the ItemCommand event for the LinkButton like so: // this is used to handle the ItemCommand...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
0
by: aiasso | last post by:
Hi All, Need big time help with this one. I'm using Forms Authentication with an ASP.NET (VB.NET) web app, and everything is fine until the client opens a popup window using javascript on the...
1
by: Jennyfer J Barco | last post by:
Hello I have a datagrid and a linkbuttom in the datagrid that says Picture, every time I click on the link "Picture" my program opens a popup window showing a picture of the item the selected and...
15
by: H00ner | last post by:
Hello All Hope you can help Been pulling my hair out about a popup problem in ASP.NET. One of the forms i wrote requires the user to select a product from a list in a popup web form. the...
1
by: gvrajkumar | last post by:
Hi Popup window is opened and after some time session has expired. After session expire, if the user tries to make any actions on the popup page the user is redirected to login.jsp page. What...
2
by: VMI | last post by:
I have a LinkButton_search on my Page1.aspx that opens up a popup page called popup.aspx. I do this with LinkButton.Attributes.Add() on the Page_Load of Page1.aspx. How can I add server-side code...
2
by: =?Utf-8?B?U3VyZXNoIFJlZGR5?= | last post by:
I am getting a strange problem with IE7 tabs. The web application I am working (developed in ASP.Net, .Net 2.0), will show a popup message with the count down timer 2 minutes before session time...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.