This article mainly introduces jQuery's usage of $. the asynchronous ajax refresh method involves some techniques related to jQuery's implementation of ajax asynchronous refresh for data interaction, and provides a complete demo for readers to download and reference, for more information about jQuery usage, see the example in this article. ajax asynchronous refresh method. We will share this with you for your reference. The details are as follows:
Recently, jquery is used to asynchronously read data. jquery provides many built-in asynchronous reading functions to demonstrate the most common $. ajax usage.
Enter a content in the client text box, and then return the time on the server.
The ashx file is used in the DEMO to obtain server information.
Slice
The escape () function can encode a string so that the string can be read on all computers.
Client code
<% @ Page Language = "C #" AutoEventWireup = "true" CodeFile = "Default7.aspx. cs" Inherits = "Default7" %>
Server code
<%@ WebHandler Language="C#" Class="ContentHandler" %> using System; using System.Web; public class ContentHandler : IHttpHandler { public void ProcessRequest (HttpContext context) { string output = ""; string name = context.Request.Params["name"]; output = GetJsonData(name); context.Response.ContentType = "text/plain"; context.Response.Write(output); } public bool IsReusable { get { return false; } } public string GetJsonData(string aa) { string result = "{name:/""+aa+"/",dt:/""+DateTime.Now.ToString()+"/"}"; return result; } }
Click here to download the complete instance code.
I hope this article will help you with jQuery programming.