PDA

View Full Version : js errors


AN-net
04-07-2004, 08:48 PM
heres my script:

<script language="javascript">
$img[entry_name]= new Image();
$img[entry_name].src="$img[entry_url]";
</script>

this is whats in my body:

<body onload="document.images[0].src=$img[entry_name]">

heres my error

expected ';'


anyone whats wrong?

Zachery
04-07-2004, 08:51 PM
heres my script:

<script language="javascript">
$img[entry_name]= new Image();
$img[entry_name].src="$img[entry_url]";
</script>

this is whats in my body:

<body onload="document.images[0].src=$img[entry_name]">

heres my error


anyone whats wrong?
Shouldnt there be a ; at the end of the onload?

AN-net
04-07-2004, 08:56 PM
nope but i found out why it was working. now it just wont load the specified image, anyone know. its basically a preload image script:)

Dean C
04-07-2004, 09:43 PM
Bad way of doing it. I suggest using the code here :):

http://javascript.internet.com/generators/preload-images.html