SRL Archive - Web Development

How can i do this?


Wade007

2009-12-05 19:20:42

When people go to exit my webpage i would like a popup to open up now i have searched around quite alot and failed and was hoping someone knew how to here ;)

I would like the popup to basically be a small window of www.google.com for example.


Edit
Would also love to know how to go around making a website like http://www.flashvisites.com/ or http://www.clics-echange.site1.biz/index.php

Kyle Undefined

2009-12-05 22:28:15

Why would you want to make a pop up when someone closes the browser? That kind of stuff is annoying. Also, I don't know what either of the sites are talking about cause I can't read them. But they seem simple enough. What part do you like about them?

~Camo

Bionicle

2009-12-06 15:14:48

you mean like this?

tico2

2009-12-06 15:26:17

From: bionicle1800
you mean like this?


You pwned me :D

Bionicle

2009-12-06 15:29:30

From: tico2
You pwned me :D


shh don't let em know :p

Hobbit

2009-12-06 15:30:26

Yeah for holding down enter :p

Floor66

2009-12-06 15:48:26

I second that :D
Anyway, isn't there some JS attribute onExit or onReturn or something?

EDIT:
I believe it's onUnLoad!
Just change your <body> tag to:
<body onUnLoad="alert('You are exiting, yadayadayada.');">

Wade007

2009-12-08 18:24:43

From: bionicle1800
you mean like this?


More as before they try to leave a website so they go to press "X" or back and then a popup like are you sure you want to leave we can give you a product for 5$ off out of… and so on and so forth

—————————————————————————————
Your template could not be parsed as it is not well-formed. Please make sure that all XML elements are closed properly.
XML error message: Element type "body" must be followed by either attribute specifications, ">" or "/>".

<body onLoad='javascript;popUp('http://www.example.com')">

Wade007

2009-12-09 08:51:53

[PHP]<html>

<head>

<script LANGUAGE="JavaScript">
<!– Begin function popUp(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "',
'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=20,height=20,left = 1000,top = 0');"); }
// End
</script>
</head>
<body onLoad="javascript:popUp('http://google.com')">

</body>
</html>[/PHP]


Sorry for double post guys but this is really annoying me now :'( it still will not create a popup and i don't know why

http://pastebin.com/m766ea8d7 source my website any help me add please?

Kyle Undefined

2009-12-09 09:08:34

Hmm…I see what you're doing? Have you tried to call just the function? Also, is it giving the same error?

<body onLoad="popUp('http://www.google.com')">

or

<body onLoad="function popUp('http://www.google.com')">

or maybe even this

<body onLoad="javascript: popUp('http://www.google.com')">

~Camo

*EDIT* Doh! Why didn't I see that before? You open up your <!– but you never close it :o Anyway, below is a working copy :D


<html>
<head>
<script LANGUAGE="JavaScript">
<!--
function popitup(url){
newwindow=window.open(url,'name','height=200,width=150');
if (window.focus) {newwindow.focus()}
return false;
}
//-->
</script>
</head>
<body onLoad="javascript: popitup('http://www.google.com')">
</body>
</html>

Wade007

2009-12-09 09:11:18

Just tried didnt work ;(

Floor66

2009-12-09 09:17:23

[php]
<html>
<head>
<script type="text/javascript">
<!–
function popUp(URL, Title)
{
window.open(URL, Title, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=20,height=20,left = 1000,top = 0');
}
–>
</script>
</head>
<body onUnLoad="popUp('http://google.com', 'Wait!');">

</body>
</html>
[/php]

try that.

Wade007

2009-12-09 09:23:21

<body onLoad='function popUp(&apos;http://www.google.com&apos;)'>

everytime i try to save that it adds &pos; does that mean anything?


::edit::

Tried floor66 and didnt work it would save but wouldnt work if it helps im using blogspot.com

Kyle Undefined

2009-12-09 09:25:09

&apos; means apostrophe. Look what I posted above, I edited my post. It works just fine.

~Camo

Wade007

2009-12-09 09:33:07

From: Camo Developer
&apos; means apostrophe. Look what I posted above, I edited my post. It works just fine.

~Camo


Still isnt working for me maybe its blogspot? I placed it in exactly how it is in the posts above.

Kyle Undefined

2009-12-09 09:34:15

Hmm…I've never used blogspot so I don't know how they do things…

~Camo