Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to parse asp response with jQuery ajax?
    primarykey
    data
    text
    <p>I have a simple lookup form that gets data from an asp server. Once a user submits the form, a table is updated on the same page. I'm trying to convert the lookup to use ajax so that only the tables reload instead of the entire page. but how do I pass an asp variable as the data value to pass to the server? and how do I actually parse the data returned from the asp server? How I currently have it setup I get no response. If I hardcode a data value, and do alert "test" the ajax call works.. Any help for a noob would be appreciated!</p> <p>getinfo.asp</p> <pre><code>&lt;form name="form" method="get" action="getinfo.asp"&gt; &lt;input id="appendedInputButton" name="txtsearch" value="&lt;%=txtSearch%&gt;" type="text"&gt; &lt;button id="submitform" type="submit" onclick="event.preventDefault();" &gt;Search&lt;/button&gt; &lt;/form&gt; &lt;div id="showresults"&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Name: &lt;%=name%&gt;&lt;/td&gt; &lt;td&gt;Email: &lt;%=email%&gt;&lt;/td&gt; &lt;td&gt;Phone: &lt;%=phone%&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;script&gt; $('#submitform').click(function() { $.ajax({ url: "getinfo.asp", data: { txtsearch: $('#appendedInputButton').val() }, type: "GET", dataType : "html", success: function( html ) { $('#showresults').html(html, '#showresults'); }, error: function( xhr, status ) { alert( "Sorry, there was a problem!" ); }, complete: function( xhr, status ) { alert( "The request is complete!" ); } }); }); &lt;/script&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.
    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