不知道你有没有用过jQuery类似的js框架。

解决方案 »

  1.   

    在Myjs.js中定义
    var Myjs = {};
    Myjs.Find = function(){
    };
    然后就可以用Myjs.Find()来调用了...
      

  2.   


    // Map over jQuery in case of overwrite
    if ( typeof jQuery != "undefined" )
    var _jQuery = jQuery;var jQuery = window.jQuery = function(a,c) {
    // If the context is global, return a new object
    if ( window == this || !this.init )
    return new jQuery(a,c);

    return this.init(a,c);
    };// Map over the $ in case of overwrite
    if ( typeof $ != "undefined" )
    var _$ = $;

    // Map the jQuery namespace to the '$' one
    window.$ = jQuery;
    .....
      

  3.   

    做成一个类 如var Myjs = {
    find:function(){
    alert("123")
    },
    find2:function(){
    }
    };调用的时候
    Myjs.find()
      

  4.   

    var Myjs = {};
    Myjs.find = function(){}
      

  5.   

    把你Myjs.js 里所有东西包成一个function
    使用的时候new 一个对象出来,就可以使用他的方法了