basic javascript question

B

bbxrider

i'm new to javascript but have programmed lots in vb, cobol, basic, etc
jscript seems much more object oriented to me, much more direct manipulation
of properties at least, than vb, don't know about methods yet

i'm having trouble locating property 'trees' so to speak, at least for
html/web and jscript objects
like in this code:
function MM_preloadImages() {
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length;
i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}
ok so a document has .images and .MM_p and .MM_p has length, etc
and a function has .arguments and .agruments have .length, etc
and then i guess since .arguments, variable a, is multiple, a list, etc
when created (var a =) its automatically created as an array and then all
arrays? have .indexOf property

so what i can't seem to find in groups, google, my 'javascript definitive
guide' is
what are html document properties
what are jscript function properties, what are jscript array properties
is there a set way to find this stuff or is it dig em out little by little
one by one???
 
R

Richard Cornford

bbxrider said:
i'm new to javascript but have programmed lots in vb, cobol, basic, etc
jscript seems much more object oriented to me, much more direct
manipulation of properties at least, than vb, don't know about methods
yet
i'm having trouble locating property 'trees' so to speak, at least
for html/web and jscript objects
like in this code:
function MM_preloadImages() {

This looks like a Dreamweaver function. If attempting to learn
JavaScript, Dreamweaver code should not be examined or treated as an
example; it is some of the worst JavaScript in existence and also
appears to be authored with the intention that it not be understandable
(after all, why would Macromedia want people to understand
HTML/JavaScript/CSS? They would no longer need their products).
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
i<a.length; i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image;
d.MM_p[j++].src=a;}}
}
ok so a document has .images
and .MM_p and .MM_p has length, etc


The document is given a 'MM_p' property by the code - if(!d.MM_p)
d.MM_p=new Array(); -. So, 'MM_p' is a property that refers to a new and
empty JavaScript Array.

so what i can't seem to find in groups, google, my 'javascript
definitive guide' is
what are html document properties

document properties vary from one browser to another and some of them
(form and image references, etc) depend on the HTML that defines the
document.
exsamples:-

Opera 7.11
<URL: http://www.litotes.demon.co.uk/o711/a.html?br=o71 >
Mozilla 1.2
<URL: http://www.litotes.demon.co.uk/m12/a.html?br=m12 >
IceBrowser 5.4
what are jscript function properties, what are jscript array properties
is there a set way to find this stuff or is it dig em out little by little
one by one???

The standard properties of JavaScript funcitons and Arrays are defined
in the ECMA Script specification.

<URL: http://www.jibbering.com/faq/#FAQ3_2 >

Richard.
 
B

bbxrider

thanks for your help, especially the tip about possible dreamweaver code and
other references
the thing that i seem to keep running into is something like this, there's a
..form hanging off document
then theres .elements hanging off of form, but the element properties are
really 'input' but thats not coded as such
and then some example code in oreilly adds a property to .elements on the
fly, so trying to follow this is slow
for me, so i guess what i was really asking if there is something like a
wall chart with all the property chains
presented as hierachies so that you can easily find
Richard Cornford said:
bbxrider said:
i'm new to javascript but have programmed lots in vb, cobol, basic, etc
jscript seems much more object oriented to me, much more direct
manipulation of properties at least, than vb, don't know about methods
yet
i'm having trouble locating property 'trees' so to speak, at least
for html/web and jscript objects
like in this code:
function MM_preloadImages() {

This looks like a Dreamweaver function. If attempting to learn
JavaScript, Dreamweaver code should not be examined or treated as an
example; it is some of the worst JavaScript in existence and also
appears to be authored with the intention that it not be understandable
(after all, why would Macromedia want people to understand
HTML/JavaScript/CSS? They would no longer need their products).
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
i<a.length; i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image;
d.MM_p[j++].src=a;}}
}
ok so a document has .images
and .MM_p and .MM_p has length, etc


The document is given a 'MM_p' property by the code - if(!d.MM_p)
d.MM_p=new Array(); -. So, 'MM_p' is a property that refers to a new and
empty JavaScript Array.

so what i can't seem to find in groups, google, my 'javascript
definitive guide' is
what are html document properties

document properties vary from one browser to another and some of them
(form and image references, etc) depend on the HTML that defines the
document.
exsamples:-

Opera 7.11
<URL: http://www.litotes.demon.co.uk/o711/a.html?br=o71 >
Mozilla 1.2
<URL: http://www.litotes.demon.co.uk/m12/a.html?br=m12 >
IceBrowser 5.4
what are jscript function properties, what are jscript array properties
is there a set way to find this stuff or is it dig em out little by little
one by one???

The standard properties of JavaScript funcitons and Arrays are defined
in the ECMA Script specification.

<URL: http://www.jibbering.com/faq/#FAQ3_2 >

Richard.
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top