Coding problem on web page with php, java script, html, and xml

Skip to first unread message

Dan Healy

Apr 5, 2013, 2:44:33 PM4/5/13
to Ubuntu Texas Local Community Team,
I believe the problem is in the following java script code segment.  A diagnostic php command is highlighted in red.  The correct execution of the code is shown in the first screen shot.  The incorrect execution of the code is shown in the second screen shot.  Some questions are presented correctly and some are not as shown in  these two screen shots.  I have been unable to figure out what the difference is.  This sample was created using Ubuntu 12.04 and Firefox.  I get the same results with Chrome on Ubuntu and with IE on MS Windows Vista.

I would appreciate any ideas what might be wrong or where I might look next.

Thanks, Dan H

Code segment:

<div id=main>

<div style="width: 80%">
    if ($question_head != "") echo $question_head."<br />";

echo $question_text."<br />";

<div type="hidden">
<span id="question"></span>
    txt=txt+"<body>&lt;b&gt;<?php echo $question_text;?>&lt;/b&gt;</body>";

// alert(txt);

    if (window.DOMParser)
      parser=new DOMParser();
    else // Internet Explorer
      xmlDoc=new ActiveXObject("Microsoft.XMLDOM");


First screen shot:

Inline image 2

Second screen shot:

Inline image 3
Screenshot from 2013-04-05 13:07:21.png
Screenshot from 2013-04-05 13:06:36.png
Reply all
Reply to author
0 new messages