Click to See Complete Forum and Search --> : Can i get a simple popup code?


huskrfreak88
02-20-2004, 11:14 PM
I would like a simple popup code if possible... Just to open another page on my server without the need of a click... thanks alot! also Paul Jr. if you see this check private please :)

Paul Jr
02-20-2004, 11:21 PM
Originally posted by huskrfreak88
I would like a simple popup code if possible... Just to open another page on my server without the need of a click... thanks alot!
Probably the simplest without the user having to click would be like this, it would just be a new window, that's all:

<body onload="window.open('page.html');">

Originally posted by huskrfreak88
also Paul Jr. if you see this check private please :)
Done. Hope I helped ya a bit there in the PM. ;)

huskrfreak88
02-20-2004, 11:27 PM
Alright Thanks... Anyway to resize?

huskrfreak88
02-20-2004, 11:32 PM
shoot hope no one is working on response... that doesn't seem to work... is it possible to have it work after around 50 alerts? If so please let me know how! thanks!!!!

Paul Jr
02-20-2004, 11:52 PM
A bit of info on the window object. (http://www.w3schools.com/js/js_window.asp)
Not sure I know what you mean by the 50 alerts thing. You want to make sure the window still opens after 50 alerts? Well... if it's set to open "onload", then it should open when the page loads.

fredmv
02-20-2004, 11:52 PM
Originally posted by huskrfreak88
50 alerts?What would cause you to have 50 alerts? :confused:

huskrfreak88
02-21-2004, 12:11 AM
i mean like <script> alert("asdjf;lkasf"); </script>......
THOSE alerts... its just a joke to make a friend mad... lol!

huskrfreak88
02-21-2004, 12:15 AM
i figured out what i need to do, but i found EXACTLY what i want here, but i don't know how to modify it for ONUNLOAD as opposed to onclick..... umm here is the script Script From JS Source (http://javascript.internet.com/page-details/determined-popup.html)
also... to see the page i want it to work on... go here... be ready for CTRL+ALT+DELETE! Affecting Site (www.geocities.com/ttoyrral)

Paul Jr
02-21-2004, 12:34 AM
Originally posted by huskrfreak88
i figured out what i need to do, but i found EXACTLY what i want here, but i don't know how to modify it for ONUNLOAD as opposed to onclick..... umm here is the script Script From JS Source (http://javascript.internet.com/page-details/determined-popup.html)
also... to see the page i want it to work on... go here... be ready for CTRL+ALT+DELETE! Affecting Site (www.geocities.com/ttoyrral)

<script type="text/javascript">
function dopopup() {
var URI = "http://www.page.html";
window.open(URI, "determined", "width=200, height=300, left=100, top=100");
}
... ... ...
<body onload="dopopup();">

huskrfreak88
02-21-2004, 12:38 AM
umm a little help! where does that go and does there need to be a script close somewhere?

also is the http://www.page.html the full page or just the 'blah'.html?
<script type="text/javascript">
var pass = prompt("Enter password", "");
if(pass !="huskrfreak88") {
window.location = "pop.html"
}
else {
window.location.href = "omaha.cox.net/";
}

<script type="text/javascript">
function dopopup() {
var URI = "http://www.page.html";
window.open(URI, "determined", "width=200, height=300, left=100, top=100");
}

<body onload="dopopup();">
Nothing happens... just prompts password and takes to appropriete page....

Paul Jr
02-21-2004, 10:50 AM
Probably because the page isn't fully loading before you are redirected if you have a the correct password.

rhsunderground
02-21-2004, 11:41 PM
Originally posted by huskrfreak88

<script type="text/javascript">
var pass = prompt("Enter password", "");
if(pass !="huskrfreak88") {
window.location = "pop.html"
}
else {
window.location.href = "omaha.cox.net/";
}

<script type="text/javascript">
function dopopup() {
var URI = "http://www.page.html";
window.open(URI, "determined", "width=200, height=300, left=100, top=100");
}

<body onload="dopopup();">
Nothing happens... just prompts password and takes to appropriete page.... [/B]

the scripts that you have (which aren't closed), say that if the password isn't the right word, then the user will be taken to the popup page, which seems a bit odd. hopefully, you have more than one page's worth of code here, which isn't directly copied, else you should be having some problems. might look better like this:


<html>
<head>
<script type="text/javascript">
var pass = prompt("Enter password", "");
if(pass =="huskrfreak88") {
var URI = "popup.html";
window.open(URI, "determined", "width=200, height=300, left=100, top=100");
}
else {
window.location.href = "omaha.cox.net/";
}
</script>
</head>
<body>
blah blah blah
</body></html>
the alerts can be put it like this:
<script>
alert('poop happens, then you die')
alert('poop happens, then you die')
alert('poop happens, then you die')
alert('poop happens, then you die')
alert('poop happens, then you die')
alert('poop happens, then you die')
var pass = prompt("Enter password", "");
if(pass =="huskrfreak88") {
var URI = "popup.html";
window.open(URI, "determined", "width=200, height=300, left=100, top=100");
}
else {
window.location.href = "omaha.cox.net/";
}
</script>

huskrfreak88
02-22-2004, 03:21 PM
okey dokey i'll give that a shot! rhs r u from ralston NE??

fredmv
02-22-2004, 05:14 PM
http://www.webdevfaqs.com/javascript.php#protect