Note that there are some explanatory texts on larger screens.

plurals
  1. POAJAX/jquery doesn't work on a returned PHP-Site
    primarykey
    data
    text
    <p>my problem is the following: I designed a Webpage using divs. Via Onlick on a link I fill a div with the output of a PHP-File (MySQL-Querys). This PHP-Site is called by a XMLHttpRequest-Function in JavaScript. On the PHP-Site I want to use jQuery to dis-/enable Buttons and Textareas. These jQuery Requests doesn't work. If I call the PHP-Site directly in the Browser everything will work fine. Where's my mistake?</p> <p>JavaScript to call the PHP-Site and fill the div:</p> <pre><code>function selected_...(nr) { 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("right_details_content").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","/.../ajax_querys.php?id=selected_...&amp;nr="+nr,true); xmlhttp.send(); } </code></pre> <p>Output of PHP-Site:</p> <pre><code>if($row['anwendung'] == "...") { echo "&lt;span&gt;name:&lt;/span&gt;&lt;input type=\"text\" id=\"name\" name=\"servername\" value=\"" . $row['rechner'] . "\" disabled&gt;&lt;br&gt;&lt;br&gt;"; echo "&lt;span&gt;wort:&lt;/span&gt;&lt;input type=\"text\" id=\"word\" name=\"password\" value=\"" . $word . "\" disabled&gt;&lt;br&gt;&lt;br&gt;"; echo "&lt;span&gt;Bemerkung:&lt;/span&gt;&lt;textarea id=\"right_details_content_textarea\" rows=\"5\" name=\"bemerkung\" disabled&gt;" . $row['bemerkung'] . "&lt;/textarea&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;"; echo "&lt;input type=\"hidden\" name=\"nr\" value=\"" . $row['nr'] . "\"&gt;&lt;br&gt;"; echo "&lt;div class=\"left\"&gt;&lt;input type=\"button\" id=\"edit\" name=\"edit\" value=\"bearbeiten\"&gt;&lt;input type=\"button\" id=\"cancel\" name=\"cancel\" value=\"abbrechen\" style=\"display: none;\"&gt;&lt;/div&gt;"; echo "&lt;div class=\"center\"&gt;&lt;input type=\"button\" id=\"save\" name=\"save\" value=\"speichern\" disabled&gt;&lt;/div&gt;"; echo "&lt;div class=\"right\"&gt;&lt;input type=\"button\" id=\"delete\" name=\"delete\" value=\"l&amp;ouml;schen\"&gt;&lt;/div&gt;"; </code></pre> <p>Ajax-Part:</p> <pre><code>$(document).ready(function () { // alert('Fertig'); $("#edit").click(function(){ // alert('Click'); if($("#save").attr("disabled")) { $("#name").removeAttr("disabled"); $("#word").removeAttr("disabled"); $("#right_details_content_textarea").removeAttr("disabled"); document.getElementById("edit").style.display = "none"; document.getElementById("cancel").style.display = "inline"; $("#save").removeAttr("disabled"); } }); }); </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