Case code:
<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "
pageencoding= "UTF-8"%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD" >
<title>shortLink</title>
<script src= "Http://localhost:8090/short_link/js/jquery/jquery-1.8.3.min.js" ></script>//the introduction of the jquery framework
<script type= "Text/javascript" >
$ (document). Ready (function () {
$ ("#test"). Click (function () {
Alert ("Hello");
});
$ ("#test"). Click (function () {
Alert ("Hello 2");
});
});
function dd () {
Alert ("dd!");
}
function dd () {
Alert ("DD2");
}
function aa () {
Alert ("aa!");
}
</script>
<body>
<input id= "test" type= "button" value= "OK" onclick= "DD (); AA ();" />
</body>
Corresponding results:
DD2 aa! Hello, hello. 2
Summarize:
See from the results;
1) JS multiple response events with the same name, only the last one will be executed
2) Onclink binds multiple events and executes in left-to-right order
3) jquery binding event multiple times, and will be executed after the JS event
JS and jquery bind an ID onclink event at the same time