Jump to content
Sign in to follow this  
tototrain

AJAX example

Recommended Posts

The source code is all in the article. The database is the standard "northwind" sample that comes with SQL Server and Access.

Share this post


Link to post
Share on other sites
The source code is all in the article. The database is the standard "northwind" sample that comes with SQL Server and Access.
okie but i cant get the sample to work.. anyguys can help?

Share this post


Link to post
Share on other sites

Well, what happens? Any JavaScript errors? Anyway ASP errors? Are you running a compatible webserver setup?

Share this post


Link to post
Share on other sites

When i select the from the dropdownlist nothing happen. no error. no change in address.im running on window 7 with IIS installed and had created a virtual directory. i tried an earlier example , typing the first and last name in the form, and display welcome firstname lastname.That example was working for me.

Share this post


Link to post
Share on other sites

No... why would it?

Share this post


Link to post
Share on other sites

The script sends a HTTP request using AJAX to "getcustomer.asp?q="+str (which contains the ASP code), and gets the result back. The current page does not change.

xmlhttp.open("GET","getcustomer.asp?q="+str,true);

Share this post


Link to post
Share on other sites

Is it possible to create dynamically after selecting the ALFKI from the drop down list.Then it shows a table. But The values from the table is able to click and link to another page?

Share this post


Link to post
Share on other sites

You can modify getcustomer.asp to print out whatever you want, for example a link:

<%'...do until rs.EOF  for each x in rs.Fields	response.write("<tr><td><b>" & x.name & "</b></td>")	response.write("<td><a href=""page"">" & x.value & "</a></td></tr>")  next  rs.MoveNextloop'...%>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...