I am generating some javascript from php and am having some problems making the id=movie-quote text (and sometimes even the id="movie-titles") appear in my web page. Am I going about this the correct way?
...then in the body...HTML Code:<head> <script type="text/javascript"> var movieArray = [ ["2001: A Space Odyssey","",0], ["Chopper",'<ol><li><span class="bold quote_actor">Mark "Chopper" Read: </span><span class="line">No, I did not drive him to the hospital! Do I look like Mother Teresa to you? </span></li></ol>',1], ["The Silence of the Lambs","",0], ["Vertigo","",0] ]; var movieArrayReady = movieArray.sort(function() {return 0.5 - Math.random()}); </script> </head>
ThanksHTML Code:<div id="movie-titles" class="span6"> <script type="text/javascript"> document.write('<p><a id="0" class="btn btn-primary btn-large" value="' + movieArrayReady[0][2] + '" onclick="checkAnswer(this.value)">' + movieArrayReady[0][0] + '</a></p>'); document.write('<p><a id="1" class="btn btn-primary btn-large" value="' + movieArrayReady[1][2] + '" onclick="checkAnswer(this.value)">' + movieArrayReady[1][0] + '</a></p>'); document.write('<p><a id="2" class="btn btn-primary btn-large" value="' + movieArrayReady[2][2] + '" onclick="checkAnswer(this.value)">' + movieArrayReady[2][0] + '</a></p>'); document.write('<p><a id="3" class="btn btn-primary btn-large" value="' + movieArrayReady[3][2] + '" onclick="checkAnswer(this.value)">' + movieArrayReady[3][0] + '</a></p>'); </script> </div> <div id="movie-quote" class="span6"> <script type="text/javascript"> document.write('<blockquote class="quote-block">' + movieArray[1][1] + '</blockquote>'); </script> </div>![]()


Reply With Quote
Bookmarks