3 Replies Latest reply on Feb 25, 2013 9:12 AM by Justin Putney

    No prototyping on XML class possible

    Level 1
      Hi folks,

      I was trying to prototype the XML class form the so called Core JavaScript Classes. Unfortunately it seems impossible/forbidden:

      XML.prototype.test = function() {
      $.writeln("xml prototype");
      }
      var myXML = new XML();
      myXML.test();

      With any other class from the Core classes prototyping is possible, like:

      File.prototype.test = function() {
      $.writeln("number prototype");
      }

      RegExp.prototype.test = function() {
      $.writeln("RegExp prototype");
      }

      Socket.prototype.test = function() {
      $.writeln("Socket prototype");
      }
      ...

      So what is special to the XML class and how can I prototype, extend it?

      Thanks form any comment.

      Cheers Tino