JavaScript and client side scripting.
Moderator: General Moderators
-
Sacapuss
- Forum Commoner
- Posts: 40
- Joined: Mon May 16, 2005 9:46 pm
- Location: Earth...
Post
by Sacapuss »
Hi !
The hereunder js script doesn't work. Could anyone explain me why, please ?
Code: Select all
<img name="e;image"e;>
<script type="e;text/javascript"e;>
mon_tableau=ї
'http://lesitedelafetedudemisiecle.chez.tiscali.fr/Rudolf/Images/IM000127.JPG'
]
function imager(tableau)
{
document.image.src=tableauї0]
}
imager(mon_tableau)
</script>
Thanx for your help !
-
phpScott
- DevNet Resident
- Posts: 1206
- Joined: Wed Oct 09, 2002 6:51 pm
- Location: Keele, U.K.
Post
by phpScott »
Code: Select all
<img name="e;image"e; id="e;image1"e;>
<script type="e;text/javascript"e;>
mon_tableau=ї
'http://lesitedelafetedudemisiecle.chez.tiscali.fr/Rudolf/Images/IM000127.JPG'
];
function imager(tableau)
{
document.getElementById('image').src=tableauї0];
}
imager(mon_tableau);
</script>
should do it.
your js was wrong in the way you where addressing the image tag, the best cross browser way is to use getElementById('id');
-
Sacapuss
- Forum Commoner
- Posts: 40
- Joined: Mon May 16, 2005 9:46 pm
- Location: Earth...
Post
by Sacapuss »
Thanx for your answer, phpScott !