JavaScriptsetInterval和“this”解決方案我需要進入this從我的setInterval處理程序prefs: null,startup : function()
{
// init prefs
...
this.retrieve_rate();
this.intervalID = setInterval(this.retrieve_rate, this.INTERVAL);
},retrieve_rate : function()
{
var ajax = null;
ajax = new XMLHttpRequest();
ajax.open('GET', 'http://xyz.com', true);
ajax.onload = function()
{
// access prefs here
}
}我如何訪問這個.prefs在ajax.onload ?
JavaScriptsetInterval和“this”解決方案
守候你守候我
2019-07-05 14:55:30