本帖最后由 xiaowen_ly 于 2010-09-14 09:00:18 编辑

解决方案 »

  1.   

    ShowPage.prototype._Load = function() 加个参数?
      

  2.   

    ShowPage.prototype._Load = function() {
      var html = '<a href="javascript:new ShowPage()._DoTest()" > TEST </a>';
    }
    前提:ShowPage是一个对象
      

  3.   

    ShowPage.prototype._DoTest = function() {
      ……
    }
    返回string ?
      

  4.   

    3L的方法正确, 但是这样的话每次点击html都会new一个ShowPage(), LZ这里要留心一下
      

  5.   

    每次new一个对象不大好,有没有好的方案?
      

  6.   

    //HTML
    javascript:func();
    //js:
    var showPage;function func(){
      showPage = showPage ? showPage: new ShowPage();
      showPage._DoTest();
    }
      

  7.   

    想了下 还是改成这样
    function func(){
      if(!showPage){ showPage = new ShowPage(); }
      showPage._DoTest();
    }
      

  8.   

    js文件:
    function ObjTest(i, p) {
      this.Index = i;
      this.Count = p;
      this.ItemCount = 5;
    }
    ShowPage.prototype._Load = function() {
      var html = '<a href="javascript:hrefvalue();" > TEST </a>';
      document.write(html);
    }
     function hrefvalue() {
     return XXXXX;  
    }