Firefox getElementById problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wangers16
    New Member
    • Jul 2007
    • 57

    #16
    Here is the custom onload function:

    Code:
    function load(func) {   
      var oldonload = window.onload;   
      if (typeof window.onload != 'function') {   
        window.onload = func;   
      }
      else{   
        window.onload = function() {   
          if (oldonload) {   
           oldonload();   
          }
          else{   
          func;
          }   
        }
      }   
    }

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #17
      You can avoid using this custom script by using addEventListene r/attachEvent. See this link for more information. If that fails to solve the problem, can you remind me of the valbeta script.

      Comment

      • wangers16
        New Member
        • Jul 2007
        • 57

        #18
        Sorry for the delayed response, first time in a while I have been able to check back here

        I have looked through the page that you provided and i'm not entirely sure where to put the addEventListene r(), in relation to the page or script?

        Here is the code for the valbeta script
        Code:
        function valbeta() {
          var anchors = document.getElementsByTagName('a');
          for (var o = 0; o < anchors.length; ++o){
            anchors[o].onclick=function(){
              validate(this.getAttribute('href',2));
              return false;
            };
          }
        }

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #19
          It's been so long that I forgot what this was about.

          To use addEventListene r/attachEvent is easy. Wherever you would call your custom onload function, add an event instead.

          Comment

          • wangers16
            New Member
            • Jul 2007
            • 57

            #20
            Once again, sorry for taking so long to reply, but thank you for all of your help, it is working perfectly now. :)

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #21
              No problem. At least it's working and it's better late than never ;)

              Comment

              Working...