Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery collapsible theme in php doesn't work
    primarykey
    data
    text
    <p>I have a jquery code that shows for me collapsibles, when i put the code in html5 it works , But i need that code to came from a php page and being shown in a div in the html5, but it doesn't work ,here is the code that i put in the php + the sql connection and the files of jquerys .....</p> <pre><code>echo"&lt;div data-role='collapsible'&gt;"; while($row=mysqli_fetch_array($result)) { echo " &lt;h4&gt;" .$row['Nom']. "&lt;/h4&gt;"; echo " &lt;p&gt;" .$row['Nom']. "&lt;/p&gt;"; } echo"&lt;/div&gt;"; </code></pre> <p>but it just shows me in my div the two lines of rows ... </p> <p><strong>ADD</strong>:</p> <p>This is my php file :</p> <pre><code>&lt;?php $host = "localhost"; $port = number; $socket = ""; $user = "root"; $password = ""; $dbname = "database name"; $value =$_GET['value']; $con = new mysqli($host, $user, $password, $dbname, $port, $socket); if (!$con) { die('Could not connect: ' . mysqli_error($con)); } mysqli_select_db($con,"ajax_demo"); $sql="request"; $result = mysqli_query($con,$sql); echo'&lt;div id="accordion"&gt;'; while($row=mysqli_fetch_array($result)) { echo" &lt;h3&gt;test&lt;/h3&gt; &lt;div&gt; &lt;p&gt;test &lt;/p&gt; &lt;/div&gt;"; } echo" &lt;/div&gt;"; echo"&lt;/div&gt;"; mysqli_close($con); ?&gt; </code></pre> <p>and the html5 file is :</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;head&gt; &lt;LINK rel="stylesheet" type="text/css" href="style.css"&gt; &lt;script src="log.js" charset="ISO-8859-1"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /&gt; &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt; &lt;meta charset="utf-8"&gt; &lt;meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"&gt; &lt;title&gt; r&amp;eacute;clamation Interne &lt;/title&gt; &lt;script&gt; $(function() { $( "#accordion" ).accordion(); }); function showUser(str) { var x=document.getElementById('matr'); var str = x.value; if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","http://IP/File name/test.php?q="+str,true); xmlhttp.send(); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;/div&gt; &lt;div class="login"&gt; &lt;center&gt;&lt;h1&gt;Datas &lt;/h1&gt;&lt;/center&gt; &lt;div id="landmark-1" data-landmark-id="1"&gt; &lt;div&gt; &lt;center&gt; &lt;form name="data" &gt; &lt;input type="text" id="matr" onchange="showUser()" &gt; &lt;/form&gt;&lt;/center&gt; &lt;/div&gt; &lt;br&gt; &lt;center&gt; &lt;div id="txtHint"&gt;&lt;b&gt;Click here to show data&lt;/b&gt;&lt;/div&gt;&lt;/center&gt; &lt;/div&gt; &lt;div class="login-help"&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    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