Tag:javascript

  • JavaScript gets the regular expression of URL parameter (used to get a parameter value)

    Time:2021-4-29

    example://JavaScript parameters (multiple)var url = “B.aspx?txtA=”+document.getElementById(“txtName”).value; url +=”&txtB=”+document.getElementById(“txtAge”).value; window.open(url,’xWindow’,’width=640,height=400,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,top=250,left=430′); //B. Aspx target page Copy codeThe code is as follows: <scirpt language=’javascirpt’> <!– function GetStringValue() { String. Prototype. Getquerystring = function (name) / / name is the parameter name of the URL{ var reg = new RegExp(“(^|&|\\?)”+ name +”=([^&]*)(&|$)”), r; if (r=this.match(reg)) return unescape(r[2]); return null; […]

  • The influence of JavaScript regexp multiline on multiline matching^$

    Time:2021-4-26

    It’s all in the notes — Copy codeThe code is as follows: <script type=”text/javascript“> /^$/.test(‘\n’); // The explanation is as follows var p = /^/mg; var s = ‘1\n\n\n2\n\n3’; p.test(s); // Skip start position JS doesn’t seem to have that word —p.test(s); alert(RegExp.rightContext.replace(/\x0A/g, ‘\\a’)); //It is concluded that ^ matches the position after or at […]

  • Summary of basic knowledge of regular expression in JavaScript

    Time:2021-4-20

    Metacharacter^ $ . * + ? = ! : | \ / ( ) [ ] { } When using these symbols, you need to use “\” to transfer.If you can’t remember which punctuation marks need to be transferred, you can use backslashes when using punctuation marks“ \”Simple matching1. Direct quantity / JavaScript / matches […]

  • JavaScript regular expression (2) use skills

    Time:2021-4-12

     1、 Character class Concept:Put individual direct character into square brackets to form character class.     Note:Red is not particularly clear […] – indicates that any character in the character class satisfies the      [^…] – except for any character in the character class       … any character other than the newline (\ n) and Unicode terminator \W […]

  • Create a simple instance of drawing program with HTML 5 canvas and JavaScript

    Time:2021-4-6

    This article will guide you to create a simple drawing program using canvas and JavaScript. First, prepare the container canvas element, and then everything will be in JavaScript. XML/HTML CodeCopy content to clipboard <canvas id=“canvasInAPerfectWorld” width=“490” height=“220”></canvas>   Get the drawing environment. The context object provides methods and properties for drawing on the canvas XML/HTML CodeCopy content to clipboard […]

  • An operator that determines whether two variables in JavaScript are equal

    Time:2021-3-29

    1. Why judge? Maybe some students will have doubts when they see this title. Why do we need to judge whether the two variables in JavaScript are equal? Isn’t JavaScript already providing us with double equal sign “= =” and triple equal sign “= = =? In fact, although JavaScript provides us with the equality […]

  • Using Ajax to manipulate JavaScript objects

    Time:2021-3-27

    Although it is convenient to obtain fully formatted HTML by request, it also means that a lot of HTML tags must be transferred as well as the text content. Sometimes, we want to be able to transmit as little data as possible, and then process the data immediately. In this case, we want to get […]

  • Using Ajax to operate JavaScript objects

    Time:2021-3-26

    Although it is convenient to obtain fully formatted HTML by request, it also means that a lot of HTML tags must be transferred as well as the text content. Sometimes, we want to be able to transmit as little data as possible, and then process the data immediately. In this case, we want to get […]

  • Unified interception of fetch request return by JavaScript

    Time:2021-3-26

    The purpose of the interceptor Interceptors are generally used to process HTTP requests before or after they are sent,Such as the token implementation of login authentication (each request with a token), unified processing 404 response and so on. Previous implementation Different from Axios, fetch does not find the API related to the request return interceptor. […]

  • You don’t necessarily know about regular expressions in JavaScript

    Time:2021-3-23

    I’ve been using regular expressions to do something a little bit complicated these days, but the differences between different browsers have wasted a lot of my people. Now I’d like to sort out and list the differences between the five major browsers (ie, Firefox, chrome, Safari, opera, whichever is the current version) of regular expressions, […]

  • CSS3 + JavaScript to achieve cool breathing effect example code

    Time:2021-3-22

    Using CSS3 animation to achieve a simple cool effect, the final effect is as follows: Page structure( index.html ): <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <title>Document</title> <link rel=”stylesheet” href=”style.css”> </head> <body> <h1>Relax And Breath</h1> <div class=”container”> <div class=”circle”></div> <p id=”text”></p> <div class=”pointer-container”> <div class=”pointer”></div> </div> <div class=”gradient-circle”></div> </div> <script src=”script.js”></script> […]

  • Javascript based on Ajax does not refresh the dynamic display of file content on the web page

    Time:2021-3-2

    In this paper, an example is given to show how to dynamically display the contents of files on Web pages without refreshing in javascript based on Ajax. Share with you for your reference. The details are as follows: The following JS code is the most basic Ajax implementation of JS, which can dynamically display the […]