Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
gstrategic
Hangin' Around



Joined: Aug 15, 2005
Posts: 46

PostPosted: Thu Sep 08, 2005 8:42 pm Reply with quote

Quote:

window.open('http://www.vancouverbiz.net', 'popup', 'width=200, height=200, top=7, left=7, menubar=0, scrollbars=0, location=0, toolbar=0, resizable=0, status=0');

}


I need help with making this javascript popup to work with php. I've read around and haven't been successful.

Thanks,
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Thu Sep 08, 2005 9:39 pm Reply with quote

Add this to includes/javascript.php. I'll assume you want this called as a function in body onload.
Code:
echo "<scr^ipt>

function popup() {
    window.open('http://www.vancouverbiz.net', 'popup', 'width=200, height=200, top=7, left=7, menubar=0, scrollbars=0, location=0, toolbar=0, resizable=0, status=0');
}
</scr^ipt>";

In your themes/YOURTHEME/theme.php is where the <body> tag is constructed so you can add your onLoad="popup" code there. You could also try using a window.onload=popup statement in your javascript routine.
 
View user's profile Send private message
gstrategic







PostPosted: Fri Sep 09, 2005 2:21 pm Reply with quote

I did load the script in includes/javascript.php, but not successful with adding the onLoad command. I tried both; but I guess it's the syntax that I got wrong. Exactly how do you write the syntax to load this function and where?

Thanks,
 
Raven







PostPosted: Fri Sep 09, 2005 4:15 pm Reply with quote

<body onload="popup">
 
gstrategic







PostPosted: Fri Sep 09, 2005 4:25 pm Reply with quote

I tried that and it didn't work.
 
Raven







PostPosted: Fri Sep 09, 2005 4:28 pm Reply with quote

It should if you loaded the javascript in the javascript.php file. Check the page source and see if the javascript is getting loaded correctly. Also type [ Only registered users can see links on this board! Get registered or login! ] in your browser URL to see what the error is, if any.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©