basic javascript question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bbxrider

    basic javascript question

    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_preloadImage s() {
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.leng th,a=MM_preload Images.argument s; for(i=0; i<a.length;
    i++)
    if (a[i].indexOf("#")!= 0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    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???


  • Richard Cornford

    #2
    Re: basic javascript question

    "bbxrider" <bbxrider1@comc ast.net> wrote in message
    news:RTWVa.2117 6$uu5.2976@sccr nsc04...[color=blue]
    > i'm new to javascript but have programmed lots in vb, cobol, basic,[/color]
    etc[color=blue]
    > jscript seems much more object oriented to me, much more direct
    >manipulation of properties at least, than vb, don't know about methods
    >yet[/color]
    [color=blue]
    >i'm having trouble locating property 'trees' so to speak, at least
    >for html/web and jscript objects
    >like in this code:
    >function MM_preloadImage s() {[/color]

    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).
    [color=blue]
    >var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    > var i,j=d.MM_p.leng th,a=MM_preload Images.argument s; for(i=0;
    >i<a.length; i++)
    > if (a[i].indexOf("#")!= 0){ d.MM_p[j]=new Image;
    >d.MM_p[j++].src=a[i];}}
    >}
    >ok so a document has .images
    >and .MM_p and .MM_p has length, etc[/color]

    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.

    <snip>[color=blue]
    > so what i can't seem to find in groups, google, my 'javascript
    >definitive guide' is
    > what are html document properties[/color]

    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
    <URL: http://www.litotes.demon.co.uk/ic54/a.html?br=ic54 >
    [color=blue]
    > what are jscript function properties, what are jscript array[/color]
    properties[color=blue]
    > is there a set way to find this stuff or is it dig em out little by[/color]
    little[color=blue]
    > one by one???[/color]

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

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

    Richard.


    Comment

    • bbxrider

      #3
      Re: basic javascript question

      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" <richard@litote s.demon.co.uk> wrote in message
      news:bg9j24$eel $1@sparta.btint ernet.com...[color=blue]
      > "bbxrider" <bbxrider1@comc ast.net> wrote in message
      > news:RTWVa.2117 6$uu5.2976@sccr nsc04...[color=green]
      > > i'm new to javascript but have programmed lots in vb, cobol, basic,[/color]
      > etc[color=green]
      > > jscript seems much more object oriented to me, much more direct
      > >manipulation of properties at least, than vb, don't know about methods
      > >yet[/color]
      >[color=green]
      > >i'm having trouble locating property 'trees' so to speak, at least
      > >for html/web and jscript objects
      > >like in this code:
      > >function MM_preloadImage s() {[/color]
      >
      > 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).
      >[color=green]
      > >var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
      > > var i,j=d.MM_p.leng th,a=MM_preload Images.argument s; for(i=0;
      > >i<a.length; i++)
      > > if (a[i].indexOf("#")!= 0){ d.MM_p[j]=new Image;
      > >d.MM_p[j++].src=a[i];}}
      > >}
      > >ok so a document has .images
      > >and .MM_p and .MM_p has length, etc[/color]
      >
      > 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.
      >
      > <snip>[color=green]
      > > so what i can't seem to find in groups, google, my 'javascript
      > >definitive guide' is
      > > what are html document properties[/color]
      >
      > 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
      > <URL: http://www.litotes.demon.co.uk/ic54/a.html?br=ic54 >
      >[color=green]
      > > what are jscript function properties, what are jscript array[/color]
      > properties[color=green]
      > > is there a set way to find this stuff or is it dig em out little by[/color]
      > little[color=green]
      > > one by one???[/color]
      >
      > The standard properties of JavaScript funcitons and Arrays are defined
      > in the ECMA Script specification.
      >
      > <URL: http://www.jibbering.com/faq/#FAQ3_2 >
      >
      > Richard.
      >
      >[/color]


      Comment

      Working...