new window popups...

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
sakaveli
Forum Commoner
Posts: 60
Joined: Tue Apr 06, 2004 9:42 am

new window popups...

Post by sakaveli »

hey guys,

just trying to figure out how i can make a new browser window pop up with out any of the tool bars or buttons showing on the new window? ive been reading through the manual but cant find much.. would i have to use javascript?

sak
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

Post by evilmonkey »

Yes, this is clientside. Use javascript.
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Here's a page that shows you how to do it yourself:

http://javascript.about.com/library/wee ... 31203a.htm
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
sakaveli
Forum Commoner
Posts: 60
Joined: Tue Apr 06, 2004 9:42 am

Post by sakaveli »

thanks for the info guys, im trying to get the pop-up up but im getting a run time error which ive never had before (i guess coz ive never used java script before)

what im basically trying to do it get a shopping cart to pop-up and request that the customer calls the sales hotline(done throught the phone us.jpg file) here the code for my link to the cart:

Code: Select all

<!-- FOOTER.PHP -->
</td><td valign="top">
<!-- right menu -->
<?
if (hasItemsInCart()) &#123;
?>
<body alink="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF">
	<A HREF="javascript:popUp('cart.php')"><img src="images/viewcart.jpg"></a>
<?
&#125;
?>
</td></tr>
<tr><td colspan="3">
<center>
<!-- footer -->
<?
	//include("include/db.php");  //everything should already be included from header.php
	//$result = query("select footer from config");
	$result = query("select footer from config");
	$array = mysql_fetch_array($result,$db);
	echo $array&#1111;footer];
	echo "<br><font size=1>".date("d/m/Y h:i:s")."</font>\n";
?>
</center>
</td></tr>
<? CloseTable(); ?>
</center>
</body>
</html>
and now heres the code to display my pop-up window with the picture:

Code: Select all

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by:  Nic Wolfe (Nic@TimelapseProductions.com) -->
<!-- Web URL:  http://fineline.xs.mw -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL) &#123;
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=700,left = 262,top = 34');");
&#125;
// End -->
</script>
<img src="images/phone us.jpg">
as soon as i click the link for the cart.php file i get an error!
any ideas whats going wrong?
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Post by liljester »

what is the error you get?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Your window title (second argument) cannot have any spaces and I've also had problems with underline characters. Are you just trying to name it the value of the id variable? Why not just have id instead of all that string concatenation. Also, you cannot have any spaces in your feature list, such as "left = 262, top = 34"
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply