Go Premium for a chance to win a PS4. Enter to Win


How to handle JQuery Ajax Results

Posted on 2009-05-08
Medium Priority
Last Modified: 2012-05-06
Hi to all,

I am trying to use the JQuery Plugin found here:

I am new to JavaScript so I am not sure how to handle the data returned by my Ajax request. The code below is what I think it should be, but the response is not populating the auto complete drop down. That is the only part that I am not sure of and I am pretty sure that is the part that is wrong, but again... I am new to this so I can't be sure where I am going wrong.

Any Help would be appretiated.

Members.aspx.vb Page:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim AllMembers As DataTable = LoadMembers()
Dim WholeAddress As String = Nothing
For Each member In AllMembers.Rows
Dim MemberName As String = member("Member Name").ToString()
Response.Write("Name:" & MemberName & Environment.NewLine)
End Sub
$().ready(function() {
        // Give each example an anchor tag
        var count = 1;
        $.each($('.demo'), function() {
            var $example = $(this);
            $example.before('<a name="demo' + count++ + '" />');
        // Set up our example table of contents
        count = 1; // reset our counter
        var $toc = $('#toc');
        $.each($('.example > td'), function() {
            var $td = $(this);
            var anchor = $(document.createElement('a')).attr('href', '#demo' + count++);
            // Create link back to top (floated right)
                .html('<a href="#toc">Top</a>')
                .css('float', 'right')
<form id="form1" runat="server">
<div style="height:18px"></div>
<div id="ffb2"></div>

Open in new window

Question by:ALawrence007
  • 2
  • 2

Accepted Solution

ycTIN earned 2000 total points
ID: 24342037
i suggest you try Example 1 first

save following content and named json.txt
    {"id":"7","name":"Guinea Pig"},  


Assisted Solution

ycTIN earned 2000 total points
ID: 24342047
if example 1 is work,  this mean client side code is no problem
then you can try example 2

server page Members.aspx should be return JSON text format data

How to convet data to JSON format :

Author Comment

ID: 24343739
I tried what you said: Sample one first and that also did not work. Maybe it is something I am doing. I looked at the other post and that also did not work.
Any help further would be appreciated.

Author Closing Comment

ID: 31579670
Simple Result in the end: My result did not start with:
{"results":[  ...... And end with : ]}
Thanks ycTIN

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question