Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ DOM event handlers add notes     - findmnt- Looking mounted file system (Linux)

- A command to install Sublime Text 3 on Manjaro / Archlinux (Linux)

- CentOS install pip (Linux)

- Graphing tool: Gnuplot (Linux)

- How to clear the v $ archived_log view expiration information (Database)

- Copy and paste in Linux terminal and Vim (Linux)

- The traffic monitoring system: cacti (Linux)

- Linux Oracle delete archived logs (Database)

- Detailed use Zabbix monitoring Nginx (Server)

- Use Docker containers (Linux)

- Linux (CentOS) directory file management and file system file compression packing (Linux)

- Linux instructions and examples GPG encryption and decryption (Linux)

- Joseph Central Java implementation (Programming)

- to compile FFmpeg In Ubuntu (Linux)

- Hadoop 2.6.0 stand-alone / pseudo-distributed installation (Server)

- Nginx Beginner Guide (Server)

- ORA-30926 and MERGE tables empty the temporary occupation problem (Database)

- Two programs HAProxy + Heartbeat (note, the secondary server vip, normal HAProxy boot method) (Server)

- Openfire Hazelcast cluster Detailed (Server)

- PostgreSQL-XL installation and deployment (Database)

  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.
- Linux uses the SMTP proxy to send mail (Linux)
- Oracle 12c detailing the new features (Database)
- How to use SHA256 checksum files download (Linux)
- Windows Desktop use VNC remote connect Linux (Linux)
- Linux virtual machine settings network, hostname ssh access (Linux)
- OpenSSL: implementation creates a private CA, certificate signing request Explanation (Server)
- Ubuntu 14.04 LTS next upgrade gcc to gcc-4.9, gcc-5 version (Linux)
- Ubuntu arm-none-eabi-gcc compiler treated with STM32F10x (Linux)
- Linux formatted partition error Could not stat / dev / sda No such file or directory Solution (Linux)
- RedHat Linux 6.4 install Oracle 10g error (Database)
- Android main thread message system (Handler Looper) (Linux)
- Household use Linux Security (Linux)
- To deploy MySQL database with separate read and write OneProxy (Database)
- Create several practical points of high security PHP site (Linux)
- Replace element and non-replaced elements of learning (Programming)
- How to remove the Linux memory Cache, Buffer and swap space (Linux)
- Ubuntu users to install voice switch instructs the applet (Linux)
- xCAT Installation Kit (Linux)
- Oracle 11g creates virtual private directory RMAN-06004 ORA-00942 error handling (Database)
- Linux vi command list (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.