I can’t get this function to work in IE 6 / 7 (it works fine in Firefox)…
<script type="text/javascript">
Event.observe(window, 'load', function() {
alert("Loaded!");
// some more code down here, but even without it it doesn't work!
});
</script>
I’m fairly new to Prototype, am I missing something? I’ve found several posts on other forums where people have come across the same problem - but in their wisdom they found the solution out themselves but didn’t bother to post the answer!
<html>
<head>
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript">
Event.observe(window, 'load', function() {
alert("Loaded!");
// some more code down here, but even without it it doesn't work!
});
</script>
</head>
<body>
stuff
</body>
</html>
Ended up going through it removing code line by line. In hindsight I probably should have posted all of the code.
The reason it wasn’t working in IE was because I used ‘class’ as a variable name somewhere else on the page - must be a reserved word or something? Funny how it worked in Firefox though.