Note that there are some explanatory texts on larger screens.

plurals
  1. POerror in xhr.send( ( s.hasContent && s.data ) || null ) using ajax
    primarykey
    data
    text
    <p>i have two files , one is html5 that has a script that loads data from an input and send it using ajax to another php file and show the php response in a div in the html5 page. I'm using the eclipse browser, but i'm having a probleme when i verify my page in the chrome console and i found that there is a problem in this line : </p> <pre><code>xhr.send( ( s.hasContent &amp;&amp; s.data ) || null ); </code></pre> <p>This is my html file :</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;head&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="jquery.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt; &lt;script&gt; (function ($) { // used to keep a reference to the ajax request object var searchQuery = false; var showUser = function (str) { if (searchQuery != false) // if there is a pending request, cancel it searchQuery.abort(); var searchTerm = $('#matr').val(); // if (str.trim().length &lt; 1) if (searchTerm.trim().length &lt; 1 ){ $("#txtHint").html(''); return; } // clean up the old accordion if ($("#accordion").length &gt; 0) $("#accordion").accordion('destroy'); $("#txtHint").html('searching...'); searchQuery = $.ajax({ 'url':'http://IP/filename/accueil.php?q='+searchTerm, 'success':function (response) { searchQuery = false; $('#txtHint').html(response); $('#accordion').accordion(); }, 'error': function () { searchQuery = false; $('#txtHint').html('Sorry, there was an error'); } }); }; // add the change event to the text field, once the page loads $(document).ready(function () { $('#matr').change(showUser); }); })(jQuery); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;center&gt; &lt;form name="data" &gt; &lt;label&gt;Enter the data :&lt;/label&gt; &lt;input type="text" id="matr" &gt; &lt;/form&gt;&lt;/center&gt; &lt;br&gt; &lt;center&gt; &lt;div id="txtHint"&gt;&lt;b&gt;Clique here to show data&lt;/b&gt;&lt;/div&gt;&lt;/center&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>and the php file has only connection to the sql database , and the :</p> <pre><code>$q =$_GET['q']; </code></pre> <p>to collect the value and show it in a div .</p> <p>But when i execute i get the error the jquery.js file : xhr.send( ( s.hasContent &amp;&amp; s.data ) || null );</p> <p>Please if you have any idea</p>
    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.
    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