why this doesn't work as an external file but does internally?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi guys,

I have this code Javascript code:

	if (document.images) {            

img1on = new Image();   img1on.src = "<?php echo $base_url;
?>Graphics/<?php echo $img_home_on; ?>"; 
img2on = new Image();   img2on.src = "<?php echo $base_url;
?>Graphics/<?php echo $img_programdetails_on; ?>";  
img3on = new Image();   img3on.src = "<?php echo $base_url;
?>Graphics/<?php echo $img_products_on; ?>";
img4on = new Image();   img4on.src = "<?php echo $base_url;
?>Graphics/<?php echo $img_featuredproducts_on; ?>"; 
img5on = new Image();   img5on.src = "<?php echo $base_url;
?>Graphics/<?php echo $img_faq_on; ?>";  
img6on = new Image();   img6on.src = "<?php echo $base_url;
?>Graphics/<?php echo $img_contact_on; ?>";
		
	
img1off = new Image();   img1off.src = "<?php echo $base_url;
?>Graphics/<?php echo $img_home_off; ?>"; 
img2off = new Image();   img2off.src = "<?php echo $base_url;
?>Graphics/<?php echo $img_programdetails_off; ?>";  
img3off = new Image();   img3off.src = "<?php echo $base_url;
?>Graphics/<?php echo $img_products_off; ?>";
img4off = new Image();   img4off.src = "<?php echo $base_url;
?>Graphics/<?php echo $img_featuredproducts_off; ?>"; 
img5off = new Image();   img5off.src = "<?php echo $base_url;
?>Graphics/<?php echo $img_faq_off; ?>";  
img6off = new Image();   img6off.src = "<?php echo
"{$base_url}Graphics/{$img_contact_off}"; ?>";
		
        }

When I include it in the main page it works without any problems. When I
link it as an external file it doesn't work.

As a side note, the following code example works in an external JS file:

img1off = new Image();   img1off.src = "<?php echo $base_url;
?>Graphics/home_off.gif"; 

Anyone know why the external file with two variables is not working but
it does work with one variable?

Thanks! I appreciate the help!

Regards,

Aaron

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux