PDA

View Full Version : Please help fix my BODY tag!


dysfunctionGazz
09-25-2002, 03:24 PM
Hi

I want a second thing to happen at the 'onload' event on my website... at the moment it preloads images... see below...

<BODY text=#AFE1DE bgColor=#003c38
leftMargin=0 topMargin=0 marginheight="0" marginwidth="0" onLoad="MM_preloadImages('buttons/newsover.gif','buttons/galleryover.gif','buttons/forumover.gif','buttons/linksover.gif','buttons/contactover.gif','buttons/infoover.gif','buttons/chatover.gif')">

i want the following code to fit within the 'onload' as well... i've tried but I can't work out the exact syntax to make it work... how do I fit the below into the above BODY tag?


window.open('concorde2ad.html',
'popup','width=200,height=200,left=300,top=160;newwindow.focus')

I'd be very pleased if someone could just cut and paste it correctly for me :D

Gazz

ShriekForth
09-25-2002, 03:51 PM
There are a couple of ways to do that. I would make a third function for readability. Like so.

<script>
function Init(){
MM_preloadImages('buttons/newsover.gif','buttons/galleryover.gif','buttons/forumover.gif','buttons/linksover.gif','buttons/contactover.gif','buttons/infoover.gif','buttons/chatover.gif');
window.open('flahs.html', 'popup','width=200,height=200,left=300,top=160')
popup.focus()
}
</script>

<body ... .... ... onload="Init()">


ShriekForth

dysfunctionGazz
09-25-2002, 04:36 PM
thanks for that...

i dunno if ive done it wrong tho...

no pop-up happened! ive tried IE6 and AOL7 no result on either :(

its online here

http://www.angelfire.com/id/devilman/dysfunctionwebsite/news.html

any ideas why not working?

adios
09-25-2002, 05:05 PM
popup.focus()

Can't call a method of a window object with its name. Try:

<script>
var popup = null;
function Init(){
MM_preloadImages('buttons/newsover.gif','buttons/galleryover.gif','buttons/forumover.gif','buttons/linksover.gif','buttons/contactover.gif','buttons/infoover.gif','buttons/chatover.gif');
popup=window.open('flahs.html', 'popup','width=200,height=200,left=300,top=160');
popup.focus();
}
</script>

<body ... .... ... onload="Init()">