Jump to content
Sign in to follow this  
WesleyA

javascript syntax explanation required.

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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...