Re: why this doesn't work as an external file but does internally?
| From: | Curt Zirzow | Date: | Tue, 05 Oct 2004 22:45:39 +0000 |
| Subject: | Re: why this doesn't work as an external file but does internally? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198739@lists.php.net to get a copy of this message | ||
* Thus wrote Aaron Wolski:
>
>
> >
> > What error messages are produced?
> > What does the remotely included file output?
> > Does the second variable have value?
> > Can you provide a link to where we can see the issue at play?
> > So on, and so forth.
> >
> > Look at the source of your page that "doesn't work", where the JS is
> > supposed to be, and chances are, you'll see the problem.
>
> 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; ?>";
$base_url and $img_home_on have no value in jsstuff.php thus you
have a javascript that results in:
img1on.src = "Graphics/"
Also, you should also send a javascript header with the jsstuff.php
file:
header('Content-Type: application/x-javascript');
Curt
--
The above comments may offend you. flame at will.