javascript working in Chrome, but no in other browsers
Hi people, I have the followin code:
<html>
<head>
<title>My Page</title>
</head>
<BODY>
<script id=url language=javascript src=""></script>
<script type="text/javascript">
document.getElementById("url").src = "http://www.mysite.com/mypage.aspx";
</script>
</body>
</html>
This code is working fine with Chrome, but it doesn't for other browser (IE, Firefox, Opera)... I've not been able to find where the problem is... IE gives me an error: internet explorer could not open the website. Operation aborted. The other browsers don't show any message.
Could you help me with this?
Thanks,
You document needs a Doctype. Attributes values need double quoted. language is deprecated, use type="text/javascript" instead of language=javascript. You should rather use a function called onload. Finally, I don't see the point of your code.
Thanks kor, this code is an example, my code is a bit more complex than it... but I wanted to put a simple code where everybody could see the problem.
Anyway, the problem with IE is already happening...