声明函数时,javascript,extjs调用函数不起作用

时间:2014-01-03 14:47:22

标签: javascript extjs

<body>
<script>
Ext.onReady(function(){

   function update(){
    return  "<a class=update href='javascript:updateR()'></a>";
   }
   //problem block begins
   function updateR(){}          //1
   var updateR=function(){}      //2
   //problem  block ends
  In column set the header:renderer:update,//The code here calls the function update

}
</script>
</body>

上面'代码'的顺序与真实的顺序相同。   问题是当我使用1来声明一个函数时,浏览器说updateR是未定义的,但是当它指向2时,它运行良好。   我只是无法理解为什么它会像这样工作,希望对你的帮助表示非常感谢!

0 个答案:

没有答案
相关问题