can't get the values out of an array

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cainnech
    New Member
    • Nov 2007
    • 132

    can't get the values out of an array

    Hi all,

    I'm having yet another problem with arrays. I'm trying to create an application which checks the lotterynumbers to see if I have won ;-)

    What I want to do is compare two arrays with eachother. One array are the numbers of that week, the other array are my numbers which I play with.

    Now browsing the around on the net I've found a script which I adapted to my needs however I can't get the value into the new array.

    Code:
    <HTML>
    <HEAD>
    <SCRIPT>
    function getElementsByStyleClass (className) {
      var page = window.frames["lottoframe"].document.all ? window.frames["lottoframe"].document.all :
        window.frames["lottoframe"].document.getElementsByTagName('td');
      var nummers = new Array();
      for (var i = 0; i < page.length; i++)
        if (page[i].className == className)
    document.form.output.value += "test" + " " + page[i].innerhtml + "\n";
    }
    
    function execute() {
    getElementsByStyleClass("Numbers");
    }
    
    </SCRIPT>
    
    </HEAD>
    <BODY>
    <iframe name="lottoframe" width="800" height="100" src="http://www.lotto.be/pages/show.aspx?Culture=nl&pageid=results/latest/lotto" scrolling="no" marginwidth="0" marginheight="0"></iframe>
    <br>
    <form name="form">
    <textarea name="output" cols="40" rows="10"></textarea>
    <br>
    <input type="button" value="Execute" onclick="javascript:execute()">
    </form>
    </BODY>
    </HTML>
    If I execute this code I get the 6 instances which correspond with the 6 numbers but I don't get the value. The problem is that I don't know how to get that value. If someone out there can help me, that would be appreciated.

    One last remark, if you want to test the code you need to save the htm as .hta, otherwise you can't access the website to get the values out of it.

    Thanks
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    hi ...

    line 10 should be:

    [CODE=javascript]document.form.o utput.value += "test" + " " + page[i].innerHTML + "\n";[/CODE]
    kind regards

    Comment

    • Cainnech
      New Member
      • Nov 2007
      • 132

      #3
      Gits, yet again to the rescue!

      Offcourse, silly me... Caps did it again.

      Thanks mate!

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        no problem :) ... post back to the forum anytime you have more questions ...

        kind regards

        Comment

        Working...