码迷,mamicode.com
首页 > Web开发 > 详细

ExtJs之DHTML,DOM,EXTJS的事件绑定区别

时间:2016-03-24 12:51:38      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html>
<html>
<head>
    <title>ExtJs</title>
    	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  		<link rel="stylesheet" type="text/css" href="ExtJs/packages/ext-theme-crisp/build/resources/ext-theme-crisp-all.css">
      <script type="text/javascript" src="ExtJs/ext-all.js"></script>
      <script type="text/javascript" src="ExtJs/bootstrap.js"></script>
      <script type="text/javascript" src="ExtJs/packages/ext-theme-crisp/build/ext-theme-crisp.js"></script>
</head>
<body>
<script type="text/javascript">
function hello() {
  alert(‘hello‘);
}
Ext.onReady(function(){
  function hello3(){
    alert(‘hello3‘);
    return true;
  }
  function hello4(){
    alert(‘hello4‘);
    return false;
  }

  var button = Ext.get(‘btn3‘);
  button.addListener(‘click‘, hello3);
  button.addListener(‘click‘, hello4);
})
</script>
<body>
<div id=‘id01‘ >hello, this word.</div>
<input type="button" id="btn" value="DHTML CLICK" onclick="hello()">
<input type="button" id="btn12" value="DOM CLICK">
<input type="button" id="btn3" value="ExtJs CLICK">

<script language="JavaScript">
function hello1(){
  alert(‘hello1‘);
}
function hello2(){
  alert(‘hello2‘);
}
var button = document.getElementById(‘btn12‘);
console.log(button);
button.addEventListener(‘click‘, hello1, false);
button.addEventListener(‘click‘, hello2, false);
</script>
</body>
</html>

  技术分享

ExtJs之DHTML,DOM,EXTJS的事件绑定区别

标签:

原文地址:http://www.cnblogs.com/aguncn/p/5314760.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!