ext中dom为空或者不是对象

ext中dom为空或者不是对象  

2012-11-14 20:31:49|  分类: extjs |  标签:ext  extjs  |举报|字号 订阅

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>   
 <meta http-equiv="pragma" content="no-cache">
 <meta http-equiv="cache-control" content="no-cache">
 <meta http-equiv="expires" content="0">
 <title>面板代码</title>
 <link type="text/css" rel="stylesheet" href="ext-4.1.1a/resources/css/ext-all.css">
 <script type="text/javascript" src="ext-4.1.1a/ext-all.js"></script>
 <script type="text/javascript" src="ext-4.1.1a/locale/ext-lang-zh_CN.js"></script>
 <script type="text/javascript">

      /*
       Ext.onReady(
      function (){
      new Ext.Panel({
      renderTo:'zhanghongtu',
   title:"面板头部header",
   height:200,
   html:'<h1>面板主区域</h1>',
   tbar:[{text:'顶部工具topToolbar'}]
   
   });
    });
    */

    
     
    Ext.onReady(
       function(){
      new Ext.Panel({
     renderTo: "hello",
     title:"面板头部header",
     width:300,
     height:200,
     html:'<h1>面板主区域</h1>',
     tbar:[{text:'顶部工具栏topToolbar'}],
     bbar:[{text:'底部工具栏bottomToolbar'}],
     buttons:[{text:"按钮位于footer"}]
   });
    }
       );
   
 </script>
  <body>
      <div id="hello"></div>      
  </body>
</html>

 

      一直抛出dom为空或者不是对象的问题,是因为  renderTo: "hello"语句,指向的是id=hello的div,如果没有id为hello的div自然会出现dom为空或者不是对象的错误.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值