SitePoint Sponsor

User Tag List

Results 1 to 20 of 20
  1. #1
    SitePoint Member molot0v's Avatar
    Join Date
    Aug 2003
    Location
    Melbourne, Australia
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript object arrays

    Hi all

    I've got a question:

    Can I make an object array in Javascript?

    ie.
    Code:
    function foo()
    {
      var fooNumber=10;
      fooFunction;
    }
    
    function fooFunction()
    {
      return fooNumber;
    }
    
    function makeFoos()
    {
      var someArray[100];
      var counter=0;
      for ( i=0; i<=100; i++)
      {
    
    // changes as of Aug 27:
        someArray[i] = new foo();
    
    // the offending line!
        alert(someArray[eval(i)].fooFunction());
    
      }
      
    }
    In my script (which is fairly similar to the above), when I try to refer to one of my foo's, ie.
    alert(someArray[10].fooFunction());
    Mozilla spits out the error:
    "Error: someArray[10] has no properties"

    Any ideas? Am I going about this the wrong way?

    Cheers
    Chris
    Last edited by molot0v; Aug 27, 2003 at 06:45.

  2. #2
    SitePoint Evangelist Mr. Brownstone's Avatar
    Join Date
    May 2002
    Location
    Relative
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function class_foo() {
    
    	this.fooNumber = 10;
    
    	this.fooFunction = function ( ) {
    		return this.fooNumber;
    	}
    
    }
    
    // . . .
    
    function makeFoos() {
    
    	var someArray = new Array ( 100 );
    	var counter=0;
    
    	for ( i=0; i<=100; i++) {
    		someArray[i] = new class_foo();
    	}
    
    	alert( someArray[10].fooFunction() );
    
    }
    You can also do this:
    Code:
    function class_foo() {
    
    	this.fooNumber = 10;
    
    }
    
    class_foo.prototype.fooFunction = function ( ) {
    		return this.fooNumber;
    }
    
    // . . .
    
    function makeFoos() {
    
    	var someArray = new Array ( 100 );
    	var counter=0;
    
    	for ( i=0; i<=100; i++) {
    		someArray[i] = new class_foo();
    	}
    
    	alert( someArray[10].fooFunction() );
    
    }
    Edit:

    You donít need a class_ prefix of course, I just put that there from force of habit.
    Of course, that's just my opinion. I could be wrong.

  3. #3
    SitePoint Member molot0v's Avatar
    Join Date
    Aug 2003
    Location
    Melbourne, Australia
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, well I tried doing it your way (as you'll see below) but I still get the same error. The script looks like this:

    Code:
    var count = 0;
    var holder = new Array(99);
    
    function addSelectEntry() {
     document.frmLib.elements.options[document.frmLib.elements.options.length] = new Option(this.label, this.id, false, false);
    }
    
    function makeNewReadingObject(label, value, description) {
    
     holder[count] = new readingObject(label, value, description, count);
     count++;
    
    }
    
    function readingObject(label, value, description, id) {
     this.label = label;
     this.id = count;
     count++;
     this.value = value;
     this.description = description;
     this.section = -1;
     this.addSelectEntry;
     this.getDesc;
     addSelectEntry();
    }
    
    readingObject.prototype.getDesc = function ( ) {
    		return this.description;
    }
    
    function buttonRemoveEntry() {
     box = document.frmLib.elements;
     id = box.options[box.selectedIndex].value;
    
     for ( i = 0; i < box.options.length; i++ ) {
      if ( box.options[i].value == id ) {
       document.frmLib.elements.options[i] = null;
      }
     }
    }
    
    function updateInfo() {
     box = document.frmLib.elements;
     id = box.options[box.selectedIndex].value;
    
     for ( i = 0; i < box.options.length; i++ ) {
      if ( box.options[i].value == id ) {
       return holder[document.frmLib.elements.options[i].value].description;
      }
     }
     return false;
    
    }
    The entry point is from a popup, but the link between the two windows is fine - thats not the problem. The problem comes at:
    Code:
       return holder[document.frmLib.elements.options[i].value].description;
    saying that "holder[document.frmLib.elements.options[i].value] has no properties"

    This is the first time I've bothered using JavaScript for anything other than menu stuff, so maybe I've made a mistake somewhere. I'd really rather not have to do this in PHP as minimal server load is a critical target for this project.

    Thanks
    Chris

  4. #4
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Chris,
    is this:
    document.frmLib.elements.options[i].value
    supposed to be referring to a selection list? What is 'frmLib' -- the form's name or the select's name?

    document.formName.elements['fieldName'].options[i]....

    some HTML would help

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  5. #5
    SitePoint Member molot0v's Avatar
    Join Date
    Aug 2003
    Location
    Melbourne, Australia
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    Sorry, here's the relevant HTML:
    Code:
    <form method="post" name="frmLib" action="doReading.php">
    
    <table width="50%" summary="Stuff" bgcolor="#FFFFFF" cellspacing="0">
    <tr><td class="smallH" colspan="2">Current reading files</td></tr>
    <tr>
     <td class="small" rowspan="4">
      <select class="libSelect" multiple size="4" name="elements" onChange=document.getElementById("descriptionDiv").innerHTML=updateInfo()>
      </select>
    
     </td>
     <td class="small"><input class="libButton" type="button" value="Remove Selected" onClick=buttonRemoveEntry()></td></tr>
     <tr><td class="small"><input class="libButton" type="button" value="Preview" onClick=openPreview()></td></tr>
     <td class="small"><input class="libButton" type="submit" onClick="changeName()" value="Done"></td></tr>
    
    </table>
    <input type="hidden" name="hiddendata">
      </form>
    This shouldn't make much difference to my problem, which is why I didn't include it.

    It all works fine except for the JavaScript object array, as mentioned above.

    Thanks
    Chris

  6. #6
    SitePoint Evangelist Mr. Brownstone's Avatar
    Join Date
    May 2002
    Location
    Relative
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by molot0v
    OK, well I tried doing it your way (as you'll see below) but I still get the same error. . .
    LOL, what do you mean ďtried doing it your way?Ē Youíve posted an entirely different script with an unrelated problem to what you previously posted. You do not get the same error, because I have tested both your original script, my fix for it, and your new script.

    Stop holding out on us. Post the link to your problem-page and Iíll try and help. Really I will.
    Of course, that's just my opinion. I could be wrong.

  7. #7
    SitePoint Member molot0v's Avatar
    Join Date
    Aug 2003
    Location
    Melbourne, Australia
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey

    I was just trying to paste only what I thought was related. I'd have already given the address to the page, except that it exists only behind a VPN currently because its in development at the moment (and I have no control over the VPN). The entire page looks like this:

    Code:
    <?
     require_once ("../../modules/runSelect.php");
     require_once ("../../modules/core-lib.php");
     require_once ("../../modules/staff.php");
    
     session_start();
    
     if ( !isset($_GET["cid"] ) {
      header("Location:http://www-fusion.multimedia.monash.edu.au/group4/errors/error.php?error=$e");
     }
    
     printHead("Reading Editor: ".$_GET["cid"]);
    
    ?>
    
    <form method="post" name="frmLib" action="doReading.php">
    
    <table width="50%" summary="Available Wizards" bgcolor="#FFFFFF" cellspacing="0">
    <tr><td class="smallH" colspan="2">Current reading files</td></tr>
    <tr>
     <td class="small" rowspan="4">
      <select class="libSelect" multiple size="4" name="elements" onChange=document.getElementById("descriptionDiv").innerHTML=updateInfo()>
    <?
     $usedFiles = new runQuery();
     $usedFiles->setStatement("select    a.file_name,
                                         a.file_title
    
                               from      files a,
                                         uses b,
    
    
                               where     b.chapter_id = ".$_SESSION["user"]->getChapter()."
                                    and
                                         a.chapter_year = ".$_SESSION["user"]->getYear()."
    
                               order by
                                         a.file_title asc");
    
    // I havent implemented this database action yet
    // $usedFiles->getResults();
    
    ?>
      </select>
    
     </td>
     <td class="small"><input class="libButton" type="button" value="Remove Selected" onClick=buttonRemoveEntry()></td></tr>
     <tr><td class="small"><input class="libButton" type="button" value="Preview" onClick=openPreview()></td></tr>
     <td class="small"><input class="libButton" type="submit" onClick="changeName()" value="Done"></td></tr>
    
    </table>
    <input type="hidden" name="hiddendata">
      </form>
    
      <div id="descriptionDiv">
    
      </div>
    <script language="javascript">
    var descriptions = new Array()
    var count = 0;
    var holder = new Array(99);
    
    window.open("library.php","library","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=400, height=400")
    
    function openPreview() {
     window.open("library.php","preview","toolbar=yes, location=yes, directories=no, status=yes, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=no, width=400, height=400")
    }
    
    function addSelectEntry() {
     document.frmLib.elements.options[document.frmLib.elements.options.length] = new Option(this.label, this.id, false, false);
    }
    
    function makeNewReadingObject(label, value, description) {
    
     holder[count] = new readingObject(label, value, description, count);
     count++;
    
    }
    
    function readingObject(label, value, description, id) {
     this.label = label;
     this.id = count;
     count++;
     this.value = value;
     this.description = description;
     this.section = -1;
     this.addSelectEntry;
     this.getDesc;
     addSelectEntry();
    }
    
    readingObject.prototype.getDesc = function ( ) {
    		return this.description;
    }
    
    function buttonRemoveEntry() {
     box = document.frmLib.elements;
     id = box.options[box.selectedIndex].value;
    
     for ( i = 0; i < box.options.length; i++ ) {
      if ( box.options[i].value == id ) {
       document.frmLib.elements.options[i] = null;
      }
     }
    }
    
    function updateInfo() {
     box = document.frmLib.elements;
     id = box.options[box.selectedIndex].value;
    
     for ( i = 0; i < box.options.length; i++ ) {
      if ( box.options[i].value == id ) {
       alert(document.frmLib.elements.options[i].value);
       somenumber = document.frmLib.elements.options[i].value;
       a = holder[1];
       alert(a.getDesc());
    //   return holder[document.frmLib.elements.options[i].value].description;
      }
     }
     //return false;
    
    }
    
    </script>
    (note: library.php calls makeNewReadingObject() )

    That should be it? Theres no other Javascript used in the page or any of its includes.

    Chris

  8. #8
    SitePoint Evangelist Mr. Brownstone's Avatar
    Join Date
    May 2002
    Location
    Relative
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excellent, thanks. I do have one more question though. What are you trying to achieve? I notice that you have a list-box with a button to remove items and another to preview something. The code seems unnecessarily complex to me. Perhaps if you narrow down what you want to do Iíll see if an easier solution can be found.
    Of course, that's just my opinion. I could be wrong.

  9. #9
    SitePoint Member molot0v's Avatar
    Join Date
    Aug 2003
    Location
    Melbourne, Australia
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey

    Maybe an explanation of this project might help (I've used the words "file" and "reading/study material" interchangably in this):

    There are two "versions" of this project, one that staff see, and one that student see. The project is actually going to be an online learning tool for students (for Monash University Faculty of Medicine students), including testing and reading material, divided into 13 weeks (13 weeks to a semester in Aus, don't know about anywhere else).

    Staff users add, remove and edit online quizzes and reading materials, as well as generate reports etc etc. The code I've pasted in this thread is the code for adding reading materials to a "week". This information needs to be divided again into sections, so that there can be one or more sections per week. The code at the moment does not allow for sections, only for weeks.

    The code is currently incomplete - below the select box will be another select box (maybe?) in which they can choose what section the files (in the top select box) are added in to. Thats why I wanted an object per entry in the top select box, so that I could attach whatever data I wanted on a per-file basis.

    (The other way I've done it is one file at a time, "wizard" style - less complicated for new users/staff, but faster for experienced users/staff)

    If you have any ideas how to make this process faster/simpler, but with the same speed and flexibility, I'd definately be interested in hearing it.

    Thanks
    Chris

  10. #10
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Chris,

    For starters: you cannot use 'reserved words' as element names

    Code:
    <select class="libSelect" multiple size="4" name="elements"


    The powers-that-be just don't like it. If you don't understand what I mean run this after your HTML:

    Code:
    
    for (i = 0 ; i < document.frmLib.length; i++)
    alert(document.frmLib.elements[i].name)
    


    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  11. #11
    SitePoint Member molot0v's Avatar
    Join Date
    Aug 2003
    Location
    Melbourne, Australia
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Vinnie

    Heh. I figured it would be a bad word to use, but I couldn't think of another to use when I was writing it up, and it just stuck...

    Bad habit I suppose :P

    Chris

  12. #12
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    myElements?
    myOptions?
    Where the World Once Stood
    the blades of grass
    cut me still

  13. #13
    SitePoint Member molot0v's Avatar
    Join Date
    Aug 2003
    Location
    Melbourne, Australia
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Something like that, yes I'm more interested in getting the object array to work properly at the moment though

  14. #14
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This:
    Code:
    document.frmLib.elements.options[i].

    will create an 'object is null,not a property' error

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  15. #15
    SitePoint Member molot0v's Avatar
    Join Date
    Aug 2003
    Location
    Melbourne, Australia
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh.

    Thanks! I'll go try it, give me a few minutes...

  16. #16
    SitePoint Member molot0v's Avatar
    Join Date
    Aug 2003
    Location
    Melbourne, Australia
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mozilla spits this out:
    Code:
     Error: holder[document.frmLib.theElements.options[i].value] has no properties
    in updateInfo()


  17. #17
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Chris,

    Since I don't have access to your php, I am somewhat limited...but, the following works for me.

    I tested with the following 2 objects (after the html)
    Code:
    makeNewReadingObject('Cien Anos', 22.94, 'a great book') 
    makeNewReadingObject('Cien Anos + one', 25.94, 'a better book')
    and changed this function to accept parameters and for readability:

    Code:
    function addSelectEntry(txt,val) {
    var selObj =  document.frmLib.myElements;
    var newItem = selObj.options.length;
    selObj.options[newItem] = new Option(txt,val, false, false);
    }
    as well as made the appropriate change here:
    Code:
    function readingObject(label, value, description, id)
     {
     this.label = label;
     ...
     addSelectEntry(this.label, this.id);
    }
    Note: I would change the following names: 'label', 'value', 'id', and anything else that even remotely looks like a reserved word.

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  18. #18
    SitePoint Member molot0v's Avatar
    Join Date
    Aug 2003
    Location
    Melbourne, Australia
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb

    Hey guys

    I tried the suggestions from both of you, and thank you both for your time. The answer, in the end, was to use eval() when using my "counter" variable to add objects to my object array.

    I took the tried and true road of going off, doing other work for a little while, and then coming back with a clean mind to break the problem down.

    In this little escapade (and numerous others) with Javascript I've reached my own small conclusion:
    Only a massochist would write in this inconsistent, all but useless, slow, ungainly, inelegant language. It's support for developers, in terms of debugging and tracing is nonexistent.

    Its usefulness goes little further than DHTML navigation (which is absolutely inconsistent across browsers and platforms) and simple regex form processing.

    I'm sure others would disagree, but I hope against hope that Javascript is phased out and replaced.

    For anyone interested, here is my solution (minus the HTML, PHP and all encapsulated in a single window). It should look *INCREDIBLY* familiar, because its basically the same code that I first pasted in this thread, except that in this case im using eval():

    Code:
    var count=0;
    
    var holdArray = new Array(10);
    holdArray[eval(count)] = new readingObject('somelabel0','someval0','somedesc0','someid0');
    
    holdArray[eval(count)] = new readingObject('somelabel1','someval1','somedesc1','someid1');
    
    holdArray[eval(count)] = new readingObject('somelabel2','someval2','somedesc2','someid2');
    
    alert (holdArray[2].label);
    
    function readingObject(label, value, description, id) {
     this.label = label;
     this.id = count;
     count++;
     this.value = value;
     this.description = description;
     this.section = -1;
     this.addSelectEntry;
     this.getDesc;
    }
    A case of the blind leading the temporarily blind I suppose. But still, thank you for the time you spent trying to help me, I do appreciate that you took time to try to help, so thanks again.

  19. #19
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Do not use 'eval()' -- while there may be a legitimate use for it (though I haven't been able to think of one lately), your example is definitely not one of them.
    This:
    Code:
    holdArray[eval(count)] 

    is completely useless and what could be considered as padding. Think of what you are asking the browser to do -- take the variable which contains an integer and evaluate it -- which means you are asking the browser to turn a number into a number.

    Your code works without the eval(), as shown below:
    Code:
    var holdArray = new Array(10);
    holdArray[count] = new readingObject('somelabel0','someval0','somedesc0','someid0');
    holdArray[count] = new readingObject('somelabel1','someval1','somedesc1','someid1');
    holdArray[count] = new readingObject('somelabel2','someval2','somedesc2','someid2');
    for (i = 0; i < 3; i++)
      alert ( i + ' = '+ holdArray[i].label);

    Only a massochist [sic] would write in this inconsistent, all but useless, slow, ungainly, inelegant language.
    Evidently, you weren't around for Fortran, Basic, and Cobol. Actually, for an interpreted language, javascript is relatively robust. Yes, there are many features I would like to see implemented (one being access to the heap) but I would never say that it was 'slow, ungainly, ...inelegant'. All of those adjectives are more reflective of the coder and his/her abilities, not the language per se.

    Any rate,
    Glad you solved your problem

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  20. #20
    SitePoint Evangelist Mr. Brownstone's Avatar
    Join Date
    May 2002
    Location
    Relative
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by molot0v
    Only a massochist would write in this inconsistent, all but useless, slow, ungainly, inelegant language.
    Itís not the language that is inconsistent, slow, ungainly and inelegant, but your code. I have checked your original code again and found the following problems:
    Code:
    var count = 0;
    var holder = new Array(99);
    
    function addSelectEntry() {
     document.frmLib.elements.options[document.frmLib.elements.options.length] = new Option(this.label, this.id, false, false);
    }
    
    function makeNewReadingObject(label, value, description) {
    
     holder[count] = new readingObject(label, value, description, count);
     count++;
    
    }
    
    function readingObject(label, value, description, id) {
     this.label = label;
     this.id = count;
     count++;
     this.value = value;
     this.description = description;
     this.section = -1;
     this.addSelectEntry;
     this.getDesc;
     addSelectEntry();
    }
    
    readingObject.prototype.getDesc = function ( ) {
    		return this.description;
    }
    
    function buttonRemoveEntry() {
     box = document.frmLib.elements;
     id = box.options[box.selectedIndex].value;
    
     for ( i = 0; i < box.options.length; i++ ) {
      if ( box.options[i].value == id ) {
       document.frmLib.elements.options[i] = null;
      }
     }
    }
    
    function updateInfo() {
     box = document.frmLib.elements;
     id = box.options[box.selectedIndex].value;
    
     for ( i = 0; i < box.options.length; i++ ) {
      if ( box.options[i].value == id ) {
       return holder[document.frmLib.elements.options[i].value].description;
      }
     }
     return false;
    
    }
    id = This parameter is never used.
    count++; = You have already incremented count in the readingObject() initialisation code. Consequently, using makeNewReadingObject() messes up the holdArray() by skipping indexes.
    this.addSelectEntry; = There is no use defining this, because it goes unused.
    this.getDesc; = There is no need to define this here, because you declare it with readingObject.prototype.getDesc.

    . . .

    Before looking back at your old code again I took the liberty of re-writing it using some better OOP techniques:
    Code:
    // This object defines a single readingObject.
    // . . .
    function readingObject ( label, value, description, id, counter ) {
    	this.unique_id = counter;
    	this.label = label;
    	this.value = value;
    	this.description = description;
    	this.id = id;
    	this.section = -1;
    
    	this.getDesc = function ( ) {
    		return this.description;
    	}
    
    	this.addSelectEntry = function ( ) {
    		// Commented out for testing
    //		document.frmLib.elements.options [ document.frmLib.elements.options.length ] = new Option ( this.label, this.id, false, false );
    	}
    
    	this.addSelectEntry ( );
    
    }
    
    //	This object defines a collection of readingObject's. Use the Add()
    //	function to add a new object into the holdArray.
    // . . .
    function readingObjectCollection ( ) {
    
    	this.holdArray = new Array ( );
    
    	this.Count = function ( ) {
    		return this.holdArray.length;
    	}
    
    	this.Add = function ( label, value, description, id ) {
    		this.holdArray [ this.Count ( ) ] = new readingObject ( label, value, description, id, this.Count ( ) );
    	}
    
    	this.InspectByIndex = function ( index ) {
    		// Returns null if an invalid index was specified.
    		return ( this.Count ( ) > 0 && index >= 0 && index < this.Count ( ) ) ? this.holdArray [ index ] : null;
    	}
    
    	// Why not add some more complex array-inspection functions
    	// while we're here...
    	// . . .
    	this.InspectByLabel = function ( label ) {
    
    		for ( var i = 0 ; i < this.holdArray.length ; i ++ ) {
    			if ( this.holdArray [ i ].label == label ) {
    				return this.holdArray [ i ];
    			}
    		}
    
    		// The loop fell-through; no readingObject was found with
    		// the specified label, so return null.
    		return null;
    
    	}
    
    }
    
    var oROC = new readingObjectCollection ( );
    
    //	Note that I have omitted the someid* parameters. This is because
    //	they were never used in your original implementation of the
    //	readingObject.
    //	EDIT - You can disregard the above comment.
    oROC.Add ( 'somelabel0', 'someval0', 'somedesc0', 'someid0' );
    oROC.Add ( 'somelabel1', 'someval1', 'somedesc1', 'someid1' );
    oROC.Add ( 'somelabel2', 'someval2', 'somedesc2', 'someid2' );
    
    // Some tests...
    alert ( oROC.InspectByIndex ( 2 ).label );
    alert ( oROC.InspectByLabel ( 'somelabel1' ).id );
    I tested this and it works fine. I hope you can learn something from it, and donít be too quick to slate JavaScript in future. More can be done with it than you could ever believe.
    Of course, that's just my opinion. I could be wrong.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •