Host V Language Objects

R

Robert Mark Bram

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
:)
 
R

Robert Mark Bram

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
:)
 
L

Lasse Reichstein Nielsen

Robert Mark Bram said:
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?

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.
Which means that knowledge of these objects are directly transferable to
other languages that also allow access to the DOM..

Is this correct?

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
 
D

Douglas Crockford

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?

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top