Note that there are some explanatory texts on larger screens.

plurals
  1. POAJAX doesn't show image but shows the PHP database query
    primarykey
    data
    text
    <p>Can anybody help with this I'm having trouble showing the image from a page but the sql query shows the sting just fin this is the code</p> <p><b>CODE FOR THE JQUERY</b>(Note: this is a click then load into a targeted spot)</p> <pre><code>&lt;script language="JavaScript" type="text/javascript"&gt; function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); //Not IE } else if(window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); //IE alert("Your browser doesn't support the XmlHttpRequest object. Better upgrade to Firefox."); } } var receiveReq = getXmlHttpRequestObject(); function catia() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", 'products/product-display-catia.php', true); receiveReq.onreadystatechange = handleCatia; receiveReq.send(null); } } function handleCatia() { if (receiveReq.readyState == 4) { document.getElementById('main').innerHTML = receiveReq.responseText; } } &lt;/script&gt; </code></pre> <p>This is the code for the page that the jquery tries to show <b>CODE</b></p> <pre><code>&lt;?php $result = mysql_query("SELECT * FROM products WHERE ID='6'"); while($row = mysql_fetch_array($result)) {echo" &lt;tr&gt;&lt;td&gt;&lt;img src='image/1361663812.png'&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan='2'&gt;&lt;img src='image/".$row['Logo']."'&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Product: ".$row['Product']." &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>And this is the code for the page where the navigation for the ajax is <b>code</b></p> <pre><code>&lt;div id='navi'&gt; &lt;/br&gt; &lt;/br&gt; &lt;ol&gt; &lt;li&gt;&lt;details&gt; &lt;summary&gt;Products&lt;/summary&gt; &lt;table align='center'&gt; &lt;tr&gt; &lt;td&gt;&lt;a href='javascript:catia();'&gt;Catia&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/details&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; </code></pre> <p>And this is the body where the ajax will display the page <b>Code</b></p> <pre><code>&lt;div id='bod' align="center"&gt; &lt;div id='main'&gt;a &lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload