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

From: Date: Wed, 06 Oct 2004 03:19:53 +0000
Subject: Re: why this doesn't work as an external file but does internally?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-198741@lists.php.net to get a copy of this message
Aaron Wolski wrote:
Ok.. here are 3 links: https://celestica.tristarpromotions.com/NEW/index2.php This link... you'll see that the rollover effects on the top menu work. The external JS file (called: jsstuffnew.php) has code that looks like: img1on = new Image(); img1on.src = "<?php echo $base_url; ?>Graphics/home_on.gif"; https://celestica.tristarpromotions.com/NEW/index.php This link... you'll see that the rollover effects on the top menu DO NOT work. The external JS file (called: jsstuff.php) has code that looks like: img1on = new Image(); img1on.src = "<?php echo $base_url; ?>Graphics/<?php echo $img_home_on; ?>"; As you can see, the difference between the two is the fact that the image FILE NAME is hard coded into the file as opposed to calling. https://celestica.tristarpromotions.com/NEW/index3.php This link... you'll see that the rollover effects work as well. Instead of having an external file I have embedded the JS code directly into the page. Additionally, I have use code that looks like: img1on = new Image(); img1on.src = "<?php echo $base_url; ?>Graphics/<?php echo $img_home_on; ?>"; Having visuals... does that help communicate what the problem is?
Yes, the output of your JavaScript in the second example is missing $img_home_on (it's outputting nothing). Where does this variable get set? How about posting the php code for https://celestica.tristarpromotions.com/NEW/jsstuff.php -- By-Tor.com It's all about the Rush http://www.by-tor.com

« previous php.general (#198741) next »