Jump to content

AJAX example


tototrain

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
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.

Link to comment
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);

Link to comment
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'...%>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...