I need to make an automatic popup window for my site but i dont want to place any code in the <HEAD></HEAD> tags.
Is this even possible?
| SitePoint Sponsor |

I need to make an automatic popup window for my site but i dont want to place any code in the <HEAD></HEAD> tags.
Is this even possible?
Clicgear 3.0 and Clicgear B3 Cart Bag Reviews
I am confused as to what you mean
care to explain more?
Who walks the stairs without a care
It shoots so high in the sky.
Bounce up and down just like a clown.
Everyone knows its Slinky.





Yup.
Should workHTML Code:<body onload="javascript:window.open('http://www.example.com');">
-Sam
Sam Hastings





Of course, remembering to delete the space between java and script
-Sam
Sam Hastings

thanks, that worked
Anyway of making it popup behind the existing window or making custom size or anything this way?
Clicgear 3.0 and Clicgear B3 Cart Bag Reviews


Change height and width like this:
window.open('html.html','winName','height=200,width=200');
Not sure but u could try this to make it pop up behind:
<body onload="var win=window.open('open.html','winName','height=200,width=200');win.blur();">
Yup it seems to work for me!

Popunders are evil, luckily my browser kills them. I'd advise not to use them.
IMO they're fine as long as you can see the message somewhere else. Dell's special offers on their site is a good example. It pops up when you first get to the site, but you can see the special offers in other places as wellOriginally Posted by Arkkimaagi
![]()
onload is by its very nature a javascript event, so the use of javascript: is entirely redundant.Originally Posted by Devilware.net
---
It would be much, *much* better to move the guts of the popup script into an embedded or external javascript, wrap it in a function and simply call the function in the onload event.Originally Posted by Poop_Shoot
Using inline javascript in your markup like that is only making extra work for yourself and anyone else may work on or maintain the site.
---
Ev!, if you *really* feel you have to use an automatic popup, then don't rely on it as the only way to trigger the new window.
Offer a link/button that will trigger the popup for those of us who have all automatic popups prevented by default.
It's far from ideal (or popular) to use popups to house essential site content or navigation.
Use them if you want, but be aware of the problems and potential problems that come with them.
New Plastic Arts: Visual Communication | DesignateOnline
Mate went to NY and all he got me was this lousy signature





Sorry, it's a force of habit. My first HTML book told me to do it (albeit about 5 years ago)Originally Posted by Bill Posters
-Sam
Sam Hastings


She asked for it on onload I never said that inline javascript! Or anything inline for that matter is a good idea! I was just responding to the question!
Last edited by Poop_Shoot; Aug 24, 2003 at 07:42.
No need to go on the defensive, poop_shoot. We're all aiming for the same thing.
But, just out of curiosity, why did you offer/suggest a method that you thought wasn't a good idea?
Why not show the method as you presumably would have done it yourself?
Like I say, I'm not having a pop at you, just curious.
New Plastic Arts: Visual Communication | DesignateOnline
Mate went to NY and all he got me was this lousy signature


Well Ev Said!
Without any code in the head tag I suppose that I could have done an extenal JS then link to it in the body calling it with a window.onload=function()! but generaly when trying to answer someones post I try to stick to what the asked for!I need to make an automatic popup window for my site but i dont want to place any code in the <HEAD></HEAD> tags.
Fair enough. I'd still be inclined to mention the embedded or external method and explain how and why it is better, but I totally appreciate where you're coming from.
Fwiw, by 'inline' javascript I was only referring to placing the guts of a javascript in the markup.
I think that <body onload="popupFunction();"> is still acceptable enough to keep even the most anooyingly pedantic of members (such as myself) quiet.![]()
New Plastic Arts: Visual Communication | DesignateOnline
Mate went to NY and all he got me was this lousy signature


This brings up a question is a bookmarklet concidered inline javascript!
Sorry Bill if I sounded angry in my post you caught me b4 my morning coffee!
If that's how you are *before* your morning caffeine hit, then I'll be even more inclined to steer clear of you *afterwards*.
Fwiw, I would imagine that a bookmarklet woudn't be considered as inline javascript as it's not contained inside the markup itself, whichi imho, would be the deciding factor.
If the ultimate aim is separate markup, code and styling, then you can't get much better than javascript bookmarklets. They are so separate that they aren't even contained anywhere within the site's own files.![]()
New Plastic Arts: Visual Communication | DesignateOnline
Mate went to NY and all he got me was this lousy signature
Bookmarks