I'm using tags to pull in a PHP file in the entries.tpl file, like this:
<div class="serendipity_entry_extended"><a id="extended"></a>{$adpanel}{$entry.extended}</div>
(note {$adpanel})
The HTML in the PHP file is being included, but for some reason the Javascript is not working:
<script language="Javascript">
<!--
$refurl = document.referrer;
document.write('<IFRAME SRC="http://www.domain.com/foo/tracker.php?'+$refurl+'" WIDTH=1 HEIGHT=1 FRAMEBORDER=0></IFRAME>');
//-->
</script>
It appears in the outputed source code, but does not run.
Is there something I'm missing here?
Can't get Javascript to run in an included file
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Can't get Javascript to run in an included file
Hm, it shouldn'T be a problem to run JS code there. But you are using "$refurl" for your javascript. JS does not allow variable names with $ I think.
What's your URL, where can one see it? Check it with Firefox and the JS Console open.
Regards,
Garvin
What's your URL, where can one see it? Check it with Firefox and the JS Console open.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
Guest