IE8 The browser doesn't support addEventListener, use attachEvent Instead, , But before the time type, add ’on‘, for example click Time in attachEvent It should be written in Chinese onclick.

var addEvent = function (o, e, f) {

o.addEventListener ? o.addEventListener(e, f, false) : o.attachEvent('on'+e, function(){f.call(o)})

}

Add event monitoring compatibility IE6-8 More articles about

  1. js Event monitoring Compatible browser

    js Event monitoring Compatible browser   ie use  attachEvent   w3c(firefox/chrome)   use  addEventListener Delete event monitoring ie use detachEven   ...

  2. GridView Add event listening and common attribute parsing

    1. Usage flow graph LR Prepared data source --> New adapter New adapter --> Bind data source Bind data source --> Load adapter 2. Common properties android:columnWidth: For each column ...

  3. extjs There are three ways to add event listening to components

    extjs There are three ways to add listening to components   Set... When defining the configuration of a component As shown in the code :  Java Code   xtype : 'textarea',  name : 'dataSetField',  labelSe ...

  4. Use addeventlistener by js Dynamically created elements add event listening

    Click on li Pop up content , And dynamically add li Effective after <button onclick="addFunction()"> Point I increase </button> <ul> ...

  5. es6 Add event listener

    // Define the target object to be listened on }; // Define handler var interceptor = { set: function (receiver, property, value) { console.log ...

  6. [ turn ]extjs There are three ways to add event listening to components

    Original address :http://blog.csdn.net/y6300023290/article/details/18989635 1. Set... When defining component configuration xtype : 'textarea', na ...

  7. Js Dynamically added data , Monitoring events cannot be detected

    In the development of this problem , Just some data , For example, buttons are added dynamically , As a result, adding event listening is invalid , It's OK to write directly on the page . This is the obvious problem of loading sequence . solution : $(document).ready( ...

  8. vue Add native event listening to custom components

    notes : Components registered globally or locally are called subcomponents , The component name declared in it ( as follows demo Medium child) It's a custom component Demo1- Add event listening directly to the parent component <!DOCTYPE html> <html ...

  9. React.js Little book Lesson9 - Event monitoring

    author : He has a big beard Link to the original text :http://huziketang.com/books/react/lesson9 Reprint please indicate the source , Keep original links and author information . stay React.js It's very easy to monitor events inside ...

Random recommendation

  1. typeface Unicode code

    Guest expert benefits     There is an award-winning trial & Solicitation —— The story of our struggle on the Internet      10 Monthly recommended articles summary      Join in “ Technology enthusiasts ”, Win big prizes html- Chinese fonts in CSS Show in (Unicode code ) ...

  2. EL Expression Introduction

    EL Expression Introduction EL Full name Expression Language.EL The main role : 1. get data EL Expressions are mainly used to replace JSP Script expressions in the page , From various types of web Domain To retrieve the java object . get data . ...

  3. standard I/O Temporary files in the library

    ISO C standard I/O The library provides two functions to help create temporary files . #include <stdio.h> char *tmpnam( char *ptr ); Return value : Pointer to a unique pathname FILE ...

  4. Implementing distributed queues ZooKeeper The implementation of the

    One . background There are times when , Multiple teams need to work together on a task , such as ,A Team will Hadoop The result of cluster computing is given to B The team continues to count ,B Finish your task and then hand it over to C The team continues to do . It's a bit like the workflow of a business system , Pass it on one by one , straight ...

  5. Python Use virtualenvwrapper Installing a virtual environment

    Loaded on https://www.jianshu.com/p/9f47a9801329 Python Use virtualenvwrapper Installing a virtual environment Tim_Lee  Focus on 2017.05.04 2 ...

  6. Workflow leads to https://www.flowable.org/

    Workflow leads to :   https://www.flowable.org/ origin :JBPM,Activiti

  7. Getting data from a database dynamically , Three level linkage of provinces, cities and counties , With verification , export Excel Templates

    Don't talk much , Look at the renderings , Go straight to the code . sheet   Merchant list hideSheet , Hidden after the function is completed Sheet, It is used to store the information in the drop-down box ,( Store the required data in a table according to certain rules ). Here is the code Part of the data needs to be imported ...

  8. JAVA classpath jar problem [zz]

    classpath The problem can be said to be a headache for all beginners , It's the same with me . 1) classpath The role of :   Its function is to make java Find what you want to do , Or the class you own . 2) classpath Set up :   Set up cla ...

  9. Node.js Release http service

    Node.js Release http service 2018-11-09 09:43:03   Visit  0 Simple service var http = require(\'http\'); http.createServer( ...

  10. 51nod 1119 Combinatorial number , Inverse element

    http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1119 1119 The robot goes through the square  V2 Base time limit :1 second Space restriction :13 ...