This time I will bring you the implementation methods of AJAX second-level linkage, and what are theprecautionsfor the implementation of AJAX second-level linkage. The following is a practical case, let's take a look.
BackendHandler.ashx
<%@ WebHandler Language="C#" Class="Handler" %> using System; using System.Web; using System.Data; public class Handler : IHttpHandler { Common coObj = new Common(); public void ProcessRequest(HttpContext context) { if (context.Request.Params["n"] != null) { string num = context.Request.Params["n"].ToString(); context.Response.ContentType = "text/plain"; string str = "select * from address where a_num2=" + num; DataTable dt = coObj.GetTable(str); string json = JSONHelper.DataTableToJSON(dt); context.Response.Write(json); } } public bool IsReusable { get { return false; } } }
frontend dropdownlist.html
dropdownlit
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website !
Recommended reading:
jQuery monitors text box events and explains the processing steps in detail
AJAX is implemented using proxy, JSONP, and XHR2 Cross domain
The above is the detailed content of What are the implementation methods of AJAX secondary linkage?. For more information, please follow other related articles on the PHP Chinese website!