Tag:ajax

  • Ajax synchronous and asynchronous xmlhttp code analysis

    Time:2021-12-31

    In Web script programming, asynchronous mode should be used in most cases; Sync mode will suspend the current script engine, so when you use sync mode, you should know what you want. In C + + development, synchronous mode should be the mainstream. If you must use asynchronous mode and callback, you can refer to […]

  • Ajax gets the current time dynamically (PHP)

    Time:2021-12-30

    Client code: Copy codeThe code is as follows: <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ /> < title > dynamic display time < / Title ></head> <script language=”javascript”> var xmlHttp; function createXMLHttpRequest(){ if(window.ActiveXObject){ xmlHttp = new ActiveXObject(“microsoft.XMLHTTP”); } else if(window.XMLHttpRequest){ xmlHttp = new XMLHttpRequest(); } else{ Alert […]

  • Ajax reads input text in real time (PHP)

    Time:2021-12-29

    Client code: Copy codeThe code is as follows: <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ /> < title > Untitled Document < / Title ></head> <script language=”javascript”> var xmlHttp; function createXMLHttpRequest(){ if(window.ActiveXObject){ xmlHttp = new ActiveXObject(“microsoft.XMLHTTP”); } else if(window.XMLHttpRequest){ xmlHttp = new XMLHttpRequest(); } } function sendRequest(){ […]

  • Ajax two-level cascade menu implementation code

    Time:2021-12-28

    Client code: Copy codeThe code is as follows: <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ /> < title > Untitled Document < / Title ></head> <script type=”text/javascript”> var xmlHttp; var a =new Array(); function createXMLHttpRequest(){ if(window.ActiveXObject){ xmlHttp=new ActiveXObject(“Microsoft.XMLHTTP”); } else if(window.XMLHttpRequest){ xmlHttp=new XMLHttpRequest(); } } function send_request(){ […]

  • Using Ajax to obtain the value of mouse suspension code

    Time:2021-12-27

    Client code mouseover php Copy codeThe code is as follows: <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ /> < title > mouse suspension test < / Title ></head> <script type=”text/javascript” language=”javascript”> var xmlHttp; function createXMLHttpRequest(){ if(window.ActiveXObject){ xmlHttp = new ActiveXObject(“microsoft.XMLHTTP”); } else if(window.XMLHttpRequest){ xmlHttp = new XMLHttpRequest(); […]

  • JavaScript Ajax function

    Time:2021-12-26

    Copy codeThe code is as follows: //Ajax testingvar xmlHttp; function createXMLHttpRequest(){ if(window.ActiveXObject){ xmlHttp=new ActiveXObject(“Microsoft.XMLHTTP”); } else if(window.XMLHttpRequest){ xmlHttp=new XMLHttpRequest(); } } function a(){ createXMLHttpRequest() url=”${request.contextPath}/test/forMain.action”; alert(url); statechange; xmlHttp.open(“GET”,url,true); xmlHttp.Send(null); alert(xmlHttp.responseText); } function statechange(){ alert(xmlHttp.status); If (xmlhttp. ReadyState = = 4) {/ / describes a “loaded” state; at this time, the response has been fully received.If […]

  • An Ajax class code

    Time:2021-12-24

    Basic usage: Copy codeThe code is as follows: var ajax = new AjaxObj(url); ajax.addListener(200, function(r){ alert(r); }); ajax.send(); You can also call continuously: Copy codeThe code is as follows: var ajax = new AjaxObj(url).addListener(200, function(r){ alert(r); }).send(); In addition, it also supports custom post or get requests and monitors different HTTP status codes. Look at […]

  • Correct method of Ajax special character coding for Chinese coding transmission of Ajax in GB2312

    Time:2021-12-23

    Many may be distorted in the picking process or picked without verification, but they can’t be used in real life. Therefore, they decided to experiment in an all-round way, and their efforts are not in vain. Although the final result is very simple, the process is really tired for a new Ajax student.You are welcome […]

  • The code is GB2312, so that the data received by Ajax can be displayed in Chinese

    Time:2021-12-22

    Copy codeThe code is as follows: <script> var xmlHttp; var BrowerType=”ie”; function createXML(){ try{ xmlHttp = new ActiveXObject(“Msxml2.XMLHTTP”); } catch (e){ try{ xmlHttp = new ActiveXObject(“Microsoft.XMLHTTP”); }catch(e2) { xmlHttp =false; } } if (!xmlHttp && typeof XMLHttpRequest != ‘undefined’){ xmlHttp = new XMLHttpRequest(); BrowerType = “ff”; // It is used to record whether Firefox is […]

  • Ajax implementation of the code to review sensitive words before submitting articles

    Time:2021-12-21

    So I thought of returning the Boolean value passed by Ajax when submitting. In fact, the function get2 () passed by AJAX is a sub function of chkfull (BT), which cannot pass values to external functions, and alert () does not work. Therefore, the “submit” type of the “submit” button is simply cancelled, and the […]

  • JS + Ajax asynchronously collects all videos and information from Youku album

    Time:2021-12-20

    https://www.jb51.net/article/22031.htmPersonally, I’m not very satisfied because VB Net in Net environment, the resulting network connection and regular matching consume too much, and my final application is in video acquisition submission, so I consider using JS Ajax + regular expression to achieve this goal.I haven’t systematically studied JS and regular before, so it took longer than […]

  • ASP. Net uses Ajax to realize the function of paging and local refreshing pages

    Time:2021-12-20

    The listview list is very easy to implement paging. Listview paging is very simple. Add a datapager control and give the ID of listview. That’s what I wrote in the beginning. (some people on the Internet say this is false paging?) <asp:ListView ID=”newBlogItems” runat=”server” DataSourceID=”AccessDataSource1″ ViewStateMode=”Disabled”> <ItemTemplate> <li> ….. </li> </ItemTemplate> </asp:ListView> <asp:DataPager ID=”DataPager1″ runat=”server” […]