Tag:javascript

  • 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 […]

  • Table related collation and JavaScript operation table, TR, TD

    Time:2021-2-21

    Good table property settings: Copy code The code is as follows: <table cellSpacing=”0″ cellPadding=”0″ border=’1′ bordercolor=”black” style=’border-collapse:collapse;table-layout: fixed’></table> Many people have this experience: when there is no content or visible element in a TD, the border of TD will disappear. The solution is to add a style border to the table- collapse:collapseGeneral text truncation (for […]

  • Realization of chain call in JavaScript

    Time:2021-2-18

    Chain call implementation itself is relatively simple, there are many articles on its implementation. This article further explains how to realize chain call from the perspective of return value of chain call method. What is chain call Chain call is very common in JavaScript language field, such as jQuery, promise and so on. Chain call […]

  • Parsing the process of getting the current URL path by JavaScript

    Time:2021-1-24

    This article mainly introduces the JavaScript access to the current URL path analysis process, the article through the example code is very detailed, for everyone’s study or work has a certain reference learning value, need friends can refer to 1. Assume that the full address of the current page is: http://localhost :61768/Home/Index?id=2&age=18 //Gets the URL […]

  • How to judge whether a picture is loaded based on JavaScript

    Time:2021-1-20

    This article mainly introduces how to judge whether the image is loaded based on JavaScript. The sample code is introduced in great detail, which has a certain reference learning value for everyone’s study or work. Friends in need can refer to it Here I use a tag to determine which style to display, but the […]

  • HTML + CSS + JavaScript to achieve the picture of 3D exhibition example code

    Time:2021-1-14

    1、 Picture 3D exhibition effect The size of the uploaded image is limited, and the display effect of the recorded GIF image is not very good See the link for the effect of screen recording:https://www.bilibili.com/video/BV1Bi4y1E7wk/ 2、 Code implementation 1. HTML code <!DOCTYPE HTML> <html> <head> <meta charset=”utf-8″> <meta name=”viewport” content=”width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no”> <meta name=”HandheldFriendly” […]

  • English translation of JavaScript validation for email

    Time:2021-1-10

    Try testing the following form with valid and invalid email addresses. The code uses javascript to match the users input with a regular expression. Function code: Copy codeThe code is as follows: function validate(form_id,email) { var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; var address = document.forms[form_id].elements[email].value; if(reg.test(address) == false) { alert(‘Invalid Email Address’); return false; } } In […]

  • Brief introduction of JavaScript switch statement

    Time:2021-1-6

    This article mainly introduces the use of JavaScript switch statement. The example code is introduced in great detail, which has a certain reference learning value for your study or work. If you need a friend, you can refer to it The switch statement is used to perform different actions based on different conditions. Switch (expression){ […]

  • JavaScript monitoring touch event code instance

    Time:2020-12-31

    This article mainly introduces the JavaScript monitoring touch event code example, this article through the example code introduction is very detailed, for everyone’s study or work has a certain reference learning value, need friends can refer to monitor <!DOCTYPE html> <html> <head> <meta charset=”UTF-8″> <meta name=”viewport” content=”initial-scale=1, maximum-scale=1, user-scalable=no”> < title > wsscat sliding event […]

  • Review the notes of regular expression JS in JavaScript

    Time:2020-12-17

    1、 Create regular expressions Creating a regular expression is similar to creating a string. There are two ways to create a regular expression. One is to use the new operator, and the other is to use the literal method. Copy codeThe code is as follows: Var dog = new regexp (‘dog ‘); / / first […]

  • Common methods of adding, deleting, modifying and checking HTML DOM with JavaScript

    Time:2020-11-23

    This paper describes the common methods of adding, deleting, modifying and querying HTML DOM by JavaScript. For your reference, the details are as follows: First of all, JS can modify all elements and attributes in HTML. It can also change CSS style, and can listen to all events and respond. This note mainly records how […]

  • JavaScript variable, data type, basic instance details [variable, string, array, object, etc.]

    Time:2020-11-22

    This article describes the JavaScript variables, data type basis. For your reference, the details are as follows: In this note, I record the basic knowledge of variables and data types. Because they are related, they are recorded together How to declare variables Variable declaration uses the VaR keyword. Here are some examples of variable declaration: […]