Host V Language Objects

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robert Mark Bram

    Host V Language Objects

    Howdy All!

    JavaScript uses objects created by the host: Window, Document, Form and
    Image objects
    JavaScript creates other objects by itself: String or Date etc..

    My question is: does it ever make a difference to the programmer whether you
    using a host or a language object?

    Thanks for any advice!

    Rob
    :)



  • Robert Mark Bram

    #2
    Re: Host V Language Objects

    I was thinking in terms of:
    DOM is created by the browser...
    so DOM is also available in other script languages right? Perl, VBScript..
    PHP?

    Which means that knowledge of these objects are directly transferable to
    other languages that also allow access to the DOM..

    Is this correct?

    Thanks!

    Rob
    :)


    Comment

    • Lasse Reichstein Nielsen

      #3
      Re: Host V Language Objects

      "Robert Mark Bram" <relaxedrob@REM OVE.THIS.optusn et.com.au> writes:
      [color=blue]
      > I was thinking in terms of:
      > DOM is created by the browser...
      > so DOM is also available in other script languages right? Perl, VBScript..
      > PHP?[/color]

      That depends on the browser. IE probably reveals the DOMs tructure to
      any script language that can be used with the Windows Scripting Host.
      That includes VBScript and PerlScript. Since PHP is a server-side
      script, it won't have access to the client's DOM representation.

      Other browsers, not written for Windows only, only accepts the script
      languages they understand themselves. That is often just Javascript.
      [color=blue]
      > Which means that knowledge of these objects are directly transferable to
      > other languages that also allow access to the DOM..
      >
      > Is this correct?[/color]

      Sure. There have been several examples in this group alone of
      solutions that are part VBscript and part Javascript. They interact
      through the DOM, and can even call each other.

      /L
      --
      Lasse Reichstein Nielsen - lrn@hotpop.com
      Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
      'Faith without judgement merely degrades the spirit divine.'

      Comment

      • Douglas Crockford

        #4
        Re: Host V Language Objects

        > JavaScript uses objects created by the host: Window, Document, Form and[color=blue]
        > Image objects
        > JavaScript creates other objects by itself: String or Date etc..
        >
        > My question is: does it ever make a difference to the programmer whether you
        > using a host or a language object?[/color]

        Yes. There are some objects offered by IE that are toxic to JScript. Attempting
        to access the standard object properties causes failure. I think this was just
        laziness/stupidity on Microsoft's part, but it is something you must watch out
        for.


        Comment

        Working...