Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ DOM event handlers add notes     - Linux three ways to set environment variables (Linux)

- The Linux C truncate function clears the file notes (Programming)

- Tmux Getting Start (Linux)

- Echo Command Examples (Linux)

- Linux command execution order control and pipeline (Linux)

- Ubuntu achieve initialization iptables (Linux)

- Install Java, Maven, Tomcat under Linux (Linux)

- LaTeX Getting Started Tutorial (Linux)

- Generate two-dimensional code parsing code Java (Programming)

- Ubuntu Server security risk checks (Linux)

- Linux installation beautify early experience (Linux)

- Linux some lessons learned about network security (Linux)

- Syncthing: Private Security Synchronization tool to synchronize files between computers / folder (Linux)

- Xshell configure SSH free password (Server)

- JavaScript closures and the scope chain (Programming)

- Spring JDBC Comments (Programming)

- PHP security Programming Advice (Programming)

- Eclipse-4.4 crash problem solving under Debian-7.6 (Linux)

- Install Apache streaming media services on CentOS 6.4 (Server)

- Customize own small private Linux system (Linux)

 
         
  DOM event handlers add notes
     
  Add Date : 2018-11-21      
         
         
         
  Today, the system browser DOM event model of its deeper understanding of the future needs to be done in a day. First mark about the basic, deeper impression.

DOM element method to add an event handler:

1. Direct write tag js code

< Body onload = "var i = 1; alert (i);" >
< / Body >

2. Write a function name tag

< Head >
     < Script >
     function hi () {
       alert ( "hi");
     }
     < / Script >
< / Head >
< Body onload = "hi ();" >
< / Body >

The essence of the above two methods are the same, is called inline mode, the lowest efficiency.

3.js script to specify the function to the event property

window.onload = hi;

This method can be better than the previous two kinds of number, called the traditional model. Inline mode and traditional mode are all DOM Level 0 event model, it is no longer recommended.

4. Do not rely on the element attribute listener

document.addEventListener ( "click", hi, true);

In this way it belongs to DOM Level 2 event model is more efficient than all of the aforementioned method. The new way is not dependent on a specific event processing property, you can register multiple handlers for any period of time any object.
     
         
         
         
  More:      
 
- Nagios (centreon) monitoring Linux Log (Server)
- Debian 8 (amd64) installation deployment Memcached management tools MemAdmin (Server)
- About enhanced Linux / Unix server system security program (Linux)
- Python, and / or (Programming)
- Fedora 19/20 and Debian Jessie / Sid users to install FFmpeg 2.3.2 (Linux)
- Ceph single / multi-node installation summary Powered by CentOS 6.x (Server)
- MySQLbinlog combat on using data recovery (Database)
- Ubuntu development Nodejs (Linux)
- Source encountered problems and solutions when installing SaltStack (Server)
- Python 3.5 await / async (Programming)
- Talk about Java in the collection (Programming)
- Linux SVN account password to save your settings (Linux)
- CentOS7 install JDK (Linux)
- iOS custom keyboard emoji expression (Programming)
- How to download video youtube-dl in Linux (Linux)
- The execution order of Oracle WHERE condition is not from right to left (Database)
- CentOS terminal display Chinese (Linux)
- MD5 and simple to use (Linux)
- MySQL Tutorial: Building MySQL Cluster under Linux (Database)
- The next key to install Linux bash script PowerShell (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.