0

I'm no js expert but I've minimised my faulty script and tried to localise the fault without success. You can find the actual page at www.trinitywoking.org.uk. but my minimal test case is

<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<title>MinTestCase</title>
<script>window.onload = function () { // Don't run script until page is loaded
var votd = new Array();  
votd[129]="Mount Sinai was all smoke because God had come down on it as fire.";
// Prepare today's string for display
document.getElementById("keyverse").innerHTML="<p> "  +  votd[(129)] + "</p> ";
}
</script>
</head>
<body>
<h1>Target paragraph follows </h1>
<p id="keyverse">
</p>  
</body>
</html>

This runs and displays correctly on all browsers except IE lte 8. A second script runs on all browsers so it doesn't look like a permissions issue.

I'll be very grateful for any help with this. Thanks.

1 Answers1

1

Remove the <p> tags in document.getElementById() line:

document.getElementById("keyverse").innerHTML=votd[(129)];

There are already tags where you try to edit the innerHTML. IE is a very picky browser.

imulsion
  • 8,820
  • 20
  • 54
  • 84
  • Thank you so much, @imulsion. Of course it is so obvious, I should have kicked myself. The min test case runs perfectly when I fix that. I've repeated a very similar error on the same line of but I should be able to sort that easily. – user2366463 May 10 '13 at 15:36
  • @user2366463 no problem, that's what I'm here for :) We all have these "kick ourselves" problems; I've had a few myself ;) – imulsion May 10 '13 at 16:11