我不确定如何将此数组传递foo
给我需要它的另一个函数。这是我的设置:
if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200)
{
var xmlResponse = XMLHttpRequestObject.responseXML;
var foo = parseXML(xmlResponse);
dataOutput.innerHTML += foo;
}
foo = (2,4,Party---12:00,2,22,Eventalist Launch---6:00,2,18,Play Day---12:00)
JSON =["2","4","Party---12:00","2","22","Eventalist Launch---6:00","2","18","Play Day---12:00"]
所以我需要将此数组传递给 HolidayName 变量。
function getHoliday(monthSelected,theday)
{
monthSelected = monthSelected + 1
var holiday = ""
var HolidayName = "NEEDS TO BE foo"
}
我不确定是否可以在不更改 getHoliday 参数的情况下移动此数组。这是因为这个函数也在其他地方被调用,我不能混淆不同的参数。有没有办法构建一个“get”函数来获取我的数组 foo?