Tag:js

  • The most detailed JS date regular expression sharing in history

    Time:2020-6-9

    The simplest regularity is as follows: D {4} – / D {2} – / D {2}But the actual situation is not so simple, to consider, effectiveness and leap years and other issues For the effective range of dates, different application scenarios will be different. The valid range of datetime objects defined in MSDN is: 0001-01-01 […]

  • Complete example analysis of JS event mechanism

    Time:2020-6-8

    An example of this article describes the JS event mechanism. To share with you for your reference, as follows: <html> <head> < title > JS event mechanism < / Title > <meta charset=”UTF-8″/> <script type=”text/javascript”> function testOnclick(){ Alert (“I’m a click event”); } function testdblOnclick(){ Alert (“I am a double click event”); } function testOnmouseover(){ […]

  • Example of JS custom object creation and simple use

    Time:2020-6-3

    The example of this article describes the creation and simple use of JS custom object. To share with you for your reference, as follows: <html> <head> < title > JS custom function < / Title > <meta charset=”UTF-8″/> <script type=”text/javascript”> //Create custom objects //Method 1: // var obj=new Object(); //Method 2 var obj={}; obj.name= “Ancient […]

  • Several commonly used function and object definitions and usage examples of JS

    Time:2020-6-2

    In this paper, several commonly used function and object definitions and usages of JS are described. To share with you for your reference, as follows: <html> <head> < title > JS several common functions < / Title > <meta charset=”UTF-8″/> <script type=”text/javascript”> //Functions in string class var str=”clannad”; // var m=str.toUpperCase(); // alert(m); // alert(str.toUpperCase()); […]

  • Basic definition and usage example of JS function

    Time:2020-5-31

    This paper introduces the basic definition and usage of JS function. To share with you for your reference, as follows: <html> <head> < title > JS function < / Title > <meta charset=”UTF-8″/> <script type=”text/javascript”> //Declaration methods of three functions // function test1(a1,a2){ // console.log (“first method of function declaration” + A1 + A2); // […]

  • How to use local CSS / JS file through Django

    Time:2020-5-31

    This article mainly introduces how to use the local CSS / JS file through Django. The example code in this article is very detailed, which has a certain reference learning value for everyone’s study or work. You can refer to the following for friends who need it I read a lot of articles on how […]

  • An example analysis of the advanced use of prototype in JS function

    Time:2020-5-30

    An example of this paper describes the use of JS function prototype. To share with you for your reference, as follows: <html> <head> <title>js-prototype</title> <meta charset=”UTF-8″/> <script type=”text/javascript”> function animation(name,data){ this.name=name; this.data=data; this.print=function(a){ console.log(a); Return “Sego”; } } function person(name,age){ this.name=name; this.age=age; } function clannad(time){ this.time=time; } person.prototype.watch=function(name){console.log(“I am watching” + name)}; animation.prototype.include=new clannad(“2007”); clannad.prototype.visi=function […]

  • An example analysis of inheritance usage of advanced JS function

    Time:2020-5-29

    In this paper, an example is given to illustrate the inheritance usage of JS function. To share with you for your reference, as follows: Direct code, no explanation: <html> <head> < title > JS function inheritance advanced < / Title > <meta charset=”UTF-8″/> <script type=”text/javascript”> Function person (name, age) {// object creation this.name=name; this.age=age; // […]

  • JS implementation of simple print table

    Time:2020-5-21

    The example of this paper shares the specific code of JS to print forms for your reference. The specific content is as follows The effect is as follows: The code is as follows: <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> < title > print form < / Title > </head> <body> <script> var data=[ {ID: […]

  • The realization of JS object-oriented

    Time:2020-5-20

    The example of this article shares the specific code of implementing Taobao magnifying glass with JS for your reference. The specific content is as follows Description: JS object oriented — implementation of Taobao magnifier The reference of the picture is a large picture and a small picture Remember to change the Ajax used for transmission […]

  • JS uses regular subexpressions to match words with the same initial and end letters

    Time:2020-5-20

    In this paper, the example describes JS using regular subexpressions to match the first letter and the last letter of the same word. Share with you for your reference. The specific implementation method is as follows: Copy codeThe code is as follows: <html> <head> <script type=”text/javascript”>//Subexpression instance: find word with same initial and ending function […]

  • Simple calculator implemented by JavaScript

    Time:2020-5-19

    The example of this article shares the specific code of a simple calculator implemented by JavaScript for your reference. The specific content is as follows The whole calculator is composed of HTML file, JS file and CSS style sheetOverall effect: put two divs in the body, a big bag and a small one, put the […]