Forum Moderators: open
Cheers
It goes like this:
This is the script in the head:
function displayBanner(){
var imageURL=image;
var linkURL=link;
writeImage(linkURL, imageURL);
}
This is the one in the body:
displayBanner();
function writeImage (linkURL, imageURL){
document.write('<a href="'+linkURL+'"><img src="'+imageURL+'" border="0" width="125" height="125">');
}
Cheers
displayBanner()called before the
writeImage()function is written in the source?
Do you know what the error is? (type javascript: into the address bar just after the error occured).
edit>>DOH! I can see that your displayBanner() function is called before the writeImage function exists and think this may be the cause of your problems...
can you try:
function writeImage()
{
...
}
displayBanner();
Cheers
edit>>
Just in case anyone is following this - netscape seemed to have a problem with the cgi script. The cgi was outputting under a javascript mime header as part of a subroutine but netscape was trying to read the whole cgi for some reason (no idea why). So I put that sub into its on cgi doc and it works fine now.
Does Netscape have a problem with HTTP_REFERER?
I don't know but maybe NS4 doesn't pass the referer to file in the <script src="cgi" ... />, perhaps a QueryString could solve your problem, eg:
<script src="cgi-bin/myfile.pl?mode=js" ... />
edit>>> Oh, and BTW, its not just NS4, NS^ does exactly the same. I tried just printing the referer and its empty for both.
Cheers
Hope someone finds that useful!
Cheers