By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,627 Members | 1,781 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,627 IT Pros & Developers. It's quick & easy.

popup box 1 time in session

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.