Category:JavaScript

  • Also write an Ajax Request class with code

    Time:2022-5-6

    Purpose: because some modules in the blog program need Ajax, use prototype directly JS has a large volume (more than 40 K) and only uses the Ajax function. Therefore, in order to reduce the burden of downloading, it cannot be changed The code written under JS framework can only write an Ajax class according to […]

  • JS ES6 asynchronous solution

    Time:2022-5-6

    catalogue The callback function is initially used ES6 asynchronous processing model API tailored for this asynchronous model: promise The callback function is initially used Because there was no clear specification in the original j s official, the parameters in the callback function transmitted from the asynchronous function encapsulated in various third-party libraries were not clearly […]

  • Ajax resume system with JS file

    Time:2022-5-5

    Copy codeThe code is as follows: /**********************************************  * @author        skyz  * @function    javascript client ajax dealwith  * @datetime    2006-3-20  **********************************************      * Function: Create a httpRequest object  **********************************************/  function HttpRequest(){     this._httpRequest=null;                                    //HttpRequest request object     this._callBack=null;                                    //Call back function     this._domResult=true;                                    //Result if dom object or text string     this._requestData=null;                                    //Request data     this._requestResult=null;                                //HttpRequest result     this._stateString=null;                                    //Current request state string     this._error=false;                                        //Current if have error     this._callBackPara=null;                                //Current callback function parama     //internal method for get HttpRequestObject     this.init=function(){         //Judge if Not IE         if(window.XMLHttpRequest){             this._httpRequest=new XMLHttpRequest();             //Set request mime is text/xml             if(this._httpRequest.overrideMimeType){                 this._httpRequest.overrideMimeType(‘text/xml’);             }         }else if(window.ActiveXObject){             try{                 this._httpRequest=new ActiveXObject(“Msxml2.XMLHTTP”);             }catch(ex){                 try{                     this._httpRequest=new ActiveXObject(“Microsoft.XMLHTTP”);                 }catch(ex){                     this._setMessage(ex,true);                     return;                 }             }                 // this._httpRequest.setrequestheader(“Content-Type”,”text/xml;charset=gb2312″);         }         //Judge HttpRequest object create successful         if(!this._httpRequest){             this._ SetMessage (“XMLHttpRequest” object creation failed! Please try again… […]

  • JQuery implementation percentage scoring progress bar

    Time:2022-5-5

    This example shares the specific code of jQuery to realize the percentage scoring progress bar for your reference. The specific contents are as follows 1. See the effect first 2. The code is as follows: jquery. lineProgressbar. JS code is as follows (function($){ ‘use strict’; $.fn.LineProgressbar = function(options){ var options = $.extend({ percentage : null, […]

  • Tutorial on developing tab instances using object-oriented method in native JS

    Time:2022-5-4

    This tutorial encapsulates an example of a tab through the object-oriented method of JS, and explains how the object-oriented function of JS is realized in the example. Generally, the encapsulated tab program only needs a div element. Other elements are generated through JSON data, so the encapsulated tab instance is very convenient to call. First […]

  • Ajax message book source code is available for download

    Time:2022-5-4

    I didn’t intend to put this source code up. After all, it’s been a long time and hasn’t been perfect, but I found that many netizens asked me for this code. I’m a lazy person and don’t want to send it by email one by one, so I moved to my blog. If everyone likes […]

  • Generation and verification of random code with JavaScript

    Time:2022-5-4

    JavaScript random code generation and verification, for your reference, the specific contents are as follows Since there are two ways to obtain event sources, they are attached here: This is directly defined by var <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> < title > random verification code verification < / Title > <style type=”text/css”> #code{ […]

  • Find a good Ajax based message board source code (PHP version, asp version) for download

    Time:2022-5-3

    1、 Explain Hello everyone, now release the message board source code of 51ajax, which has two versions of PHP and ASP.   The PHP version is based on Ajax + PHP4 3 + MySQL 4.1 + Dojo 0.3, asp version is based on Ajax + ASP + access + Dojo 0.3. The main file of Dojo […]

  • JavaScript to achieve long picture scrolling effect

    Time:2022-5-3

    This example shares the specific code of JavaScript long picture scrolling for your reference. The specific contents are as follows The scrolling of the long chart will involve a timer: Let’s first review the timer: <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> < title > timer Review < / Title > </head> <body> < button […]

  • JS time control date multi selection

    Time:2022-5-2

    In the process of development, time is always inevitable. Here I share my commonly used JS time control and a solution to a problem layDate Official document address: https://www.layui.com/laydate/ Picture: Case code: Using laydate standalone //Execute a laydate instance laydate.render({ Elem: ‘#test1’ // specify the element }); Almost all common needs can be found here, […]

  • Ajax learning resources are available at home and abroad

    Time:2022-5-2

    Compilation mode of Ajax developers:http://www.ajaxpatterns.org/ • XMLHttpRequest tutorial: “dynamic web interface”:http://www.xml.com/pub/a/2005/02/09/xml-http-request.html • JavaScript performance benchmarks:http://blogs.ebusiness-apps.com/dave/?p=14 • Ajax resources:http://www.ajaxmatters.com/ • JavaScript specification:http://www.ecma-international.or/ … ndards/Ecma-262.htm • introduce JavaScript object identification:http://www.crockford.com/JSON/index.html • Mozilla’s venkman JavaScript debugger:http://www.mozilla.org/projects/venkman/ • XML DOM reference:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/e9da2722-7879-4e48-869c-7f16714e2824.asp • Microsoft Dynamic HTML reference: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/dhtml_reference_entry.asp • Gecko DOM Reference: http://www.mozilla.org/docs/dom/domref/ • “porting ie to Mozilla”http://www-128.ibm.com/developerworks/web/library/wa-ie2mozgd/ • Mozilla […]

  • JavaScript implementation Click to change the image shape (transform application)

    Time:2022-5-2

    Click JavaScript to change the image shape (Application of transform) for your reference. The specific contents are as follows Attach Code: <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> < title > Application of transform < / Title > <style type=”text/css”> #box{ width: 50px; height: 50px; background-color: red; /*Traslate displacement rotate rotation amplitude scale amplification amplitude […]