javascript - Page has two scripts. One runs on all browsers. One fails on IE7. -


i'm no js expert i've minimised faulty script , tried localise fault without success. can find actual page @ www.trinitywoking.org.uk. 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 loaded var votd = new array();   votd[129]="mount sinai smoke because god had come down on fire."; // prepare today's string 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 , displays correctly on browsers except ie lte 8. second script runs on browsers doesn't permissions issue.

i'll grateful this. thanks.

remove <p> tags in document.getelementbyid() line:

document.getelementbyid("keyverse").innerhtml=votd[(129)]; 

there tags try edit innerhtml. ie very picky browser.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -