window.onload = init;
function init(){
initializeEventHandlers();
getData(formatDate(new Date));
gotoDate('today');
}
//scripts that manage the UI for tracker.aspx
var dCurrentDate, sCurrentDate, sCurrentDayData, stepsVal, chipsVal, dayValue, dateValue, caloriesVal;
var fCurrentValue = 0;
var bAnimating, bSliding = false;
//scripts that manage the UI for tracker.aspx
var dCurrentDate, sCurrentDate, sCurrentDayData, stepsVal, chipsVal, dayValue, dateValue, caloriesVal;
var fCurrentValue = 0;
var bAnimating, bSliding = false;
getData(d)
{
steps = 5;
calories = 10;
chipsAmount = 3;
}
//I expect this to be 5+1, but it actually through an exception. I am wondering if its cause steps is not yet loaded. What can I do to make this actually 5 + 1.
steps + 1;
我從XML中加載設置了某些值的數據。我正面臨的問題是,當我在GetData方法中設置值時。 onload後宣佈的增值稅將失去價值。我在做什麼錯了,我該如何使值保留在onload中調用某個方法時的值重置
您是否異步加載數據?如果是這樣,這些值可能在您嘗試設置它們時不存在,所以您應該與腳本同步加載它。否則我不確定我完全理解你的問題。 – 2010-08-27 03:08:04
是的,我同步加載 – ferronrsmith 2010-08-27 04:42:05
這個問題主要是我需要在onload上設置變量,以便其他函數可以使用它們 – ferronrsmith 2010-08-27 04:47:14