get methods of DOM objects

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • oeyvind toft

    #1

    get methods of DOM objects

    I`m writing a script (for IE6) that scans a html file for all kind of
    properties. Selecting
    an object or an object id causes its propertynames and values to be written
    to a textarea.

    To get a list of functions supported by the object I use an array of
    functionnames to test against.
    However, while this works fine it is not very practical.

    Is there a way to get the names of the methods of various DOM objects ?
    Or are all marked as not enumerable and not accessable in any way?


    Oeyvind

    --





  • Martin Honnen

    #2
    Re: get methods of DOM objects



    oeyvind toft wrote:
    [color=blue]
    > I`m writing a script (for IE6) that scans a html file for all kind of
    > properties. Selecting
    > an object or an object id causes its propertynames and values to be written
    > to a textarea.[/color]

    [color=blue]
    > Is there a way to get the names of the methods of various DOM objects ?
    > Or are all marked as not enumerable and not accessable in any way?[/color]

    That depends on the browser, try to enumerate e.g.

    function getObjectProper ties (object) {
    var result = '';
    for (var property in object) {
    result += property + ': ' + object[property] + '\r\n';
    }
    return result;
    }

    getObjectProper ties(document.b ody)

    and check the result, here with IE 6 on Windows XP some event handler
    attributes are listed but other methods not.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • oeyvind toft

      #3
      Re: get methods of DOM objects

      "Martin Honnen" <mahotrash@yaho o.de> skrev i melding
      news:41403c45$0 $28479$9b4e6d93 @newsread4.arco r-online.net...
      [color=blue]
      > and check the result, here with IE 6 on Windows XP some event handler
      > attributes are listed but other methods not.[/color]

      Thanks for your reply Martin.

      I`ve done the basic object scanning in about the same way as you do. And I
      get the same result:
      some handlers.

      However, what I`m interested in is the
      addBehavior, applyElement, appendChild etc...methods.

      Its easy to set up an array and test for those methods, but as I said,
      a bit inpractical.

      (Allthou I`m currently looking for a complete list (not info, just a simple
      list) of all the IE6 DOM object methods that could
      be useful when setting up a complete function names array)


      Oeyvind





      Comment

      • Martin Honnen

        #4
        Re: get methods of DOM objects



        oeyvind toft wrote:

        [color=blue]
        > (Allthou I`m currently looking for a complete list (not info, just a simple
        > list) of all the IE6 DOM object methods that could
        > be useful when setting up a complete function names array)[/color]

        MSDN has a list
        http://msdn.microsoft.com/library/de...ce/methods.asp

        --

        Martin Honnen
        http://JavaScript.FAQTs.com/

        Comment

        • oeyvind toft

          #5
          Re: get methods of DOM objects

          Perfect, just what I was looking for...:o)

          Thanks again Martin

          Oeyvind

          --




          "Martin Honnen" <mahotrash@yaho o.de> skrev i melding
          news:41404a7d$0 $440$9b4e6d93@n ewsread2.arcor-online.net...[color=blue]
          >
          >
          > oeyvind toft wrote:
          >
          >[color=green]
          > > (Allthou I`m currently looking for a complete list (not info, just a[/color][/color]
          simple[color=blue][color=green]
          > > list) of all the IE6 DOM object methods that could
          > > be useful when setting up a complete function names array)[/color]
          >
          > MSDN has a list
          >[/color]
          http://msdn.microsoft.com/library/de...ce/methods.asp[color=blue]
          >
          > --
          >
          > Martin Honnen
          > http://JavaScript.FAQTs.com/[/color]


          Comment

          Working...