PDA

View Full Version : Write javascript into <script> tags


mark wills
10-30-2002, 06:34 PM
<script language="JavaScript" id="Imsg"></script>
...
...
... some HTML stuff here ...
...
...
<script language="JavaScript">
Imsg.src="alert('hello')';"
</script>

The above code works in IE but not in Netscape. The alert() actually gets written into the empty Imsg script tags. How can I do the same in Netscape?

Any ideas?

Mark.

chrismiceli
10-31-2002, 01:50 AM
not sure but on the following code if the image doesn't load it will say the alt in its place so mabey this is what you are looking for


<img src="" alt="hello">

is that what you are looking for?