Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  About browser event

First look at following codes:var $ = KISSY.all;$(‘a’).on(‘click’,function(e){doSomeThing();//This function seems very famouse.halt();});The above codes seem complete the work we want them. The browser will not redirect us to the link in href, but is there some issue with the codes above?Before explaining what's wrong with the above codes, we first need to understand some concepts.Browser default behaviorWhen we click a link, the browser will redirect us to another link; when pressing ENTER key, the form will submit automatically. These are the default behavior of brows...

2,712 0       JAVASCRIPT EVENT EVENT BUBBLING EVENT CAPTURING