Hi I'm writing a script that uses an object (contstructed by myself) from antother .js file. The first line in the script just construct an instant of the object. Or should do, more correctly. IE 5.5 keeps saying that "'Matches' is undefined". Here's snippets of the code:
***********************
matches.js:
***********************
[tt]
/* Objekt för hantering av matcherna från Databasen */
function Matches(year, month) {
this.matches = new Array;
this.dateStack = new Array;
this.year = year;
this.month = month;
this.addMatch = mAddMatch;
this.getMatches = mGetMatches;
}
[/tt]
... (more code follows in the file)
***********************
javascript-test.html
***********************
[tt]
<html>
<head>
<title> JavaScript - test </title>
<script language="JavaScript" src="matches.js"></script>
<script language="JavaScript">
function init() {
//
var decMatches = new Matches(2002,12);
decMatches.addMatch(5,"A","18:00","Seriematch","Mossens IP","Mossens IP","St Jakob"
decMatches.addMatch(5,"C","17:00","Seriematch","Heden","Heden 7","Andra BK"
matches = decMatches.getMatches(2002+12+5+""
str = "";
for (var i=0; i<matches.length; i++) {
var tempMatch = matches;
str = str + "|" + tempMatch.team + "|" + tempMatch.time + "|" + "<br>" +
"|" + tempMatch.type + "|" + tempMatch.place + "|" + "<br>" +
"|" + tempMatch.field + "|" + tempMatch.opponent + "|<br><br>";
}
document.write(str);
}
</script>
[/tt]
... (more code follows in the file)
Anyone got an idéa what's wrong?
***********************
matches.js:
***********************
[tt]
/* Objekt för hantering av matcherna från Databasen */
function Matches(year, month) {
this.matches = new Array;
this.dateStack = new Array;
this.year = year;
this.month = month;
this.addMatch = mAddMatch;
this.getMatches = mGetMatches;
}
[/tt]
... (more code follows in the file)
***********************
javascript-test.html
***********************
[tt]
<html>
<head>
<title> JavaScript - test </title>
<script language="JavaScript" src="matches.js"></script>
<script language="JavaScript">
function init() {
//
var decMatches = new Matches(2002,12);
decMatches.addMatch(5,"A","18:00","Seriematch","Mossens IP","Mossens IP","St Jakob"
decMatches.addMatch(5,"C","17:00","Seriematch","Heden","Heden 7","Andra BK"
matches = decMatches.getMatches(2002+12+5+""
str = "";
for (var i=0; i<matches.length; i++) {
var tempMatch = matches;
str = str + "|" + tempMatch.team + "|" + tempMatch.time + "|" + "<br>" +
"|" + tempMatch.type + "|" + tempMatch.place + "|" + "<br>" +
"|" + tempMatch.field + "|" + tempMatch.opponent + "|<br><br>";
}
document.write(str);
}
</script>
[/tt]
... (more code follows in the file)
Anyone got an idéa what's wrong?