Connecting Tech Pros Worldwide Forums | Help | Site Map

popup box 1 time in session

aznFETISH
Guest
 
Posts: n/a
#1: Jul 23 '05
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

aznFETISH
Guest
 
Posts: n/a
#2: Jul 23 '05

re: popup box 1 time in session


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" <news@aznfetish.com> wrote in message
news:J2g5e.51752$Fz.10196@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


kaeli
Guest
 
Posts: n/a
#3: Jul 23 '05

re: popup box 1 time in session


In article <Vug5e.51758$Fz.27658@tornado.tampabay.rr.com>, news@aznfetish.com
enlightened us with...[color=blue]
>
> all this code is missing is a Yes or No option[/color]

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

aznFETISH
Guest
 
Posts: n/a
#4: Jul 23 '05

re: popup box 1 time in session


That makes sense but Im still a bit lost new to this javascript

"kaeli" <tiny_one@NOSPAM.comcast.net> wrote in message
news:MPG.1cbf562b97a0ff0998a47b@nntp.lucent.com...[color=blue]
> In article <Vug5e.51758$Fz.27658@tornado.tampabay.rr.com>,
> news@aznfetish.com
> enlightened us with...[color=green]
>>
>> all this code is missing is a Yes or No option[/color]
>
> 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
>[/color]


kaeli
Guest
 
Posts: n/a
#5: Jul 23 '05

re: popup box 1 time in session


In article <KPh5e.24040$vd.22741@tornado.tampabay.rr.com>, news@aznfetish.com
enlightened us with...[color=blue]
> That makes sense but Im still a bit lost new to this javascript
>[/color]

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

aznFETISH
Guest
 
Posts: n/a
#6: Jul 23 '05

re: popup box 1 time in session


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" <tiny_one@NOSPAM.comcast.net> wrote in message
news:MPG.1cc04a52f96e281498a481@nntp.lucent.com...[color=blue]
> In article <KPh5e.24040$vd.22741@tornado.tampabay.rr.com>,
> news@aznfetish.com
> enlightened us with...[color=green]
>> That makes sense but Im still a bit lost new to this javascript
>>[/color]
>
> 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
>[/color]


kaeli
Guest
 
Posts: n/a
#7: Jul 23 '05

re: popup box 1 time in session


In article <3Gw5e.52332$Fz.11650@tornado.tampabay.rr.com>, news@aznfetish.com
enlightened us with...[color=blue]
> 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[/color]

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

Closed Thread