我是靠谱客的博主 外向大神,这篇文章主要介绍关于Ext.onReady的三种调用方法,现在分享给大家,希望可以做个参考。

方式一:
          <script>

           Ext.onReady(function(){

           alert('onready');

 

       });

 

    </script>     

              最简单了,最平常的调用,不用多说

 

方式二:
    <script>

 

       Ext.color = function(){

           return {

              init:function(){

                  alert("init")

              }

           }

       }();

       Ext.onReady(Ext.color.init,Ext.color);

    </script>


 

                   通过onReady调用color函数,init为color中的内置,作用是初始化.这种写法比较实用

 


方式三:
 

    <script>

       Ext.onReady(function(){

      

           alert('onready');

 

       });

       Ext.color = function(){

           return {

              init:function(){

                  alert("init")

              }

           }

       }();

       Ext.onReady(Ext.color.init,Ext.color);

    </script>

 

 


       这种是混合型写法,两个onReady都会被调用,调用顺序是看谁在前面.

文章出处:http://www.diybl.com/course/3_program/java/javaxl/20081010/149693.html

最后

以上就是外向大神最近收集整理的关于关于Ext.onReady的三种调用方法的全部内容,更多相关关于Ext.onReady内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(118)

评论列表共有 0 条评论

立即
投稿
返回
顶部