-
-
Save cdmcmahon/d968b9c582e7c71efb85d545d4e78a3d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nlWest = [ | |
[119, "Los Angeles", null, null, null], | |
[137, "San Francisco", null, null, null], | |
[135, "San Diego", null, null, null], | |
[109, "Arizona", null, null, null], | |
[115, "Colorado", null, null, null] | |
]; | |
var createEnterDataFunc = function(team){ | |
return function(data) { | |
team[2] = parseInt(data.firstChild.nextSibling.firstChild.nextSibling.getAttribute("W")); | |
team[3] = parseInt(data.firstChild.nextSibling.firstChild.nextSibling.getAttribute("L")); | |
team[4] = parseInt(data.firstChild.nextSibling.firstChild.getAttribute("R")) - parseInt(data.firstChild.nextSibling.firstChild.nextSibling.getAttribute("R")); | |
}; | |
}; | |
for (var i = 0; i < nlWest.length; i++){ | |
var team = nlWest[i]; | |
// xml = create XML request here with team[0] as id parameter | |
xml.onload = createEnterDataFunc(team) | |
xml.send() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment