Jump to content

javascript syntax explanation required.


WesleyA

Recommended Posts

Hi all,

 

Im pretty much a noob to javascript. I try to get how the statements work together.

 

if you have a javascript command like this:

     document.all.myFile.innerText

Then document is an object and so is all

myFIle is a variable but what is innerText ?

Is that a property or a method?

 

Are there any obligations in writing these commands? like this: object.subobject.property.method?

 

Or are you free to use these through each other?

Edited by WesleyA
Link to comment
Share on other sites

AFAIK, you have to start with a reference, and work your way down, level by level. For example for document you can find a list such as the one on this page...

 

http://www.w3schools.com/jsref/dom_obj_document.asp

 

document.all seems to be an obsolete Microsoft property.

 

https://msdn.microsoft.com/library/ms537434%28v=vs.85%29.aspx

Link to comment
Share on other sites

Every object has properties. The properties may also be objects which have their own properties. There is a hierarchy, you have to know which objects have which properties.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...