473,385 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

can't get the values out of an array

132 100+
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.

Expand|Select|Wrap|Line Numbers
  1. <HTML>
  2. <HEAD>
  3. <SCRIPT>
  4. function getElementsByStyleClass (className) {
  5.   var page = window.frames["lottoframe"].document.all ? window.frames["lottoframe"].document.all :
  6.     window.frames["lottoframe"].document.getElementsByTagName('td');
  7.   var nummers = new Array();
  8.   for (var i = 0; i < page.length; i++)
  9.     if (page[i].className == className)
  10. document.form.output.value += "test" + " " + page[i].innerhtml + "\n";
  11. }
  12.  
  13. function execute() {
  14. getElementsByStyleClass("Numbers");
  15. }
  16.  
  17. </SCRIPT>
  18.  
  19. </HEAD>
  20. <BODY>
  21. <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>
  22. <br>
  23. <form name="form">
  24. <textarea name="output" cols="40" rows="10"></textarea>
  25. <br>
  26. <input type="button" value="Execute" onclick="javascript:execute()">
  27. </form>
  28. </BODY>
  29. </HTML>
  30.  
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
Jan 3 '08 #1
3 1313
gits
5,390 Expert Mod 4TB
hi ...

line 10 should be:

Expand|Select|Wrap|Line Numbers
  1. document.form.output.value += "test" + " " + page[i].innerHTML + "\n";
kind regards
Jan 4 '08 #2
Cainnech
132 100+
Gits, yet again to the rescue!

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

Thanks mate!
Jan 4 '08 #3
gits
5,390 Expert Mod 4TB
no problem :) ... post back to the forum anytime you have more questions ...

kind regards
Jan 4 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Paul C-T | last post by:
Hi, Am I trying to be too clever here? I am trying to write a PHP page to enable me to enter values into a form then write those values to a text file. I want to use the form & table that...
4
by: Greg Baker | last post by:
I don't know what standard protocol is in this newsgroup. Am I allowed to post code and ask for help? I hope so.. :) Here's my problem: I am trying problem 127 of the valladolid online...
14
by: Randell D. | last post by:
Folks, Here's my problem: I am createing an array in a file using the reslut of some PHP and MySQL processing. An example of my array would be examlpe="example one"; examlpe="example...
15
by: lawrence | last post by:
Sorry for the dumb question but I'm new to Javascript. I wrote this script hoping to animate some div blocks on a page. You can see the page here: http://www.keymedia.biz/demo.htm Can anyone...
33
by: baumann.Pan | last post by:
hi all, i want to get the address of buf, which defined as char buf = "abcde"; so can call strsep(address of buf, pointer to token);
26
by: Brett | last post by:
I have created a structure with five fields. I then create an array of this type of structure and place the structure into an array element. Say index one. I want to assign a value to field3 of...
14
by: Rich | last post by:
Yes, I need to store some values in an array type collection object that can hold 3 or more parameters per index. I have looked at the collection object, hashtable object and would prefer not to...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
2
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs,...
6
by: Bint | last post by:
I have an array whose elements I'm accessing, like array, array, etc. However, the data is meant to be 16-bit words, not bytes. I'm getting byte values right now. Is there any way I can tell php...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.