The use of conditional branch statements and loop statements in JavaScript, with simple code to achieve powerful functions

if()  else if()   else() alert() pop up warning box prompt() input box, OK: return input information; cancel: return null <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <script> var age=prompt('Please enter age!'); ...

Posted by pmeasham on Tue, 04 Feb 2020 07:55:12 -0800

Print < div id = "printarea" >?

How do I print the indicated div (without manually disabling all other content on the page)? I want to avoid using the new preview dialog, so it's useless to create a new window with this content. The page contains several tables, one of which contains the div s I want to print - the table has a visual style for the network and should no ...

Posted by delxy on Mon, 03 Feb 2020 07:21:09 -0800

JavaScript only needs 200 lines of code to develop blockchain

Implement a simple blockchain with JavaScript development. Through this development process, you will understand what blockchain technology is: blockchain is a distributed database, and the storage structure is a growing linked list, which contains many orderly records. However, in general, when we talk about blockchain, we also talk about ...

Posted by kylebragger on Mon, 03 Feb 2020 05:14:03 -0800

Js-w3school (2020.2.3) [js array]

1.JavaScript arrays are used to store multiple values in a single variable. 2. Create array: Array text method: var cars = ["Saab", "Volvo", "BMW"]; Or use the keyword new var cars = new Array("Saab", "Volvo", "BMW"); 3. We refer to an array element by referring to index number (subscript) 4. Through ...

Posted by gregor63 on Mon, 03 Feb 2020 03:30:13 -0800

Frame Buster Buster... Need buster code

Suppose you don't want other websites< iframe >Build your site: <iframe src="http://example.org"></iframe> Therefore, you will anti frame, frame damage JavaScript Insert into all your pages: /* break us out of any containing iframes */ if (top != self) { top.location.replace ...

Posted by spiceydog on Sun, 02 Feb 2020 22:22:15 -0800

Details and examples of Vue's ref

Although there are prop s and events, sometimes you may need to access a subcomponent directly in JavaScript. To do this, you can assign an ID reference to this subcomponent through the ref feature. Ref can be added to the parent component or the child component, and can be accessed through this.refs instance. The following example implements t ...

Posted by xyn on Fri, 31 Jan 2020 08:53:20 -0800

An evaluation question of Ali

  Title: const timeout = ms => new Promise((resolve, reject) => { setTimeout(() => { resolve(); }, ms); }); const ajax1 = () => timeout(2000).then(() => { console.log('1'); return 1; }); const ajax2 = () => timeout(1000).then(() => { console.log('2'); return 2; }); c ...

Posted by php_dev_101 on Fri, 31 Jan 2020 08:23:31 -0800

HandyEditor rich text editor integrated into Python flash project

1. Download HandyEditor at http://he.catfish-cms.com/   2. The unzipped file name HandyEditor master is changed to HandyEditor. The files in the folder are as follows   3. Put the HandyEditor folder into the static folder of the project, and create a new folder named uploadPhotos in the static folder to put the uploaded pictures   4. Modify ...

Posted by MarcAndreTalbot on Fri, 31 Jan 2020 07:14:15 -0800

Shopping cart settlement function JS

Shopping cart settlement function Layout: <ul>      <li></li>     <li></li>     <li></li>     ............ </ul> <p><p> Each li label represents that there are + - product quantity function in each product unit price and subtotal What is the most expensive pr ...

Posted by Zoud on Fri, 31 Jan 2020 05:42:27 -0800

node web module (server and client)

node web module web server Web server refers to website server, which refers to a program residing on the Internet, the basic function of web browser, and provides information browsing service The web supports the script language on the server side. The script language obtains data from the database and returns the results ...

Posted by fireant on Fri, 31 Jan 2020 01:59:15 -0800