angular.js我用with发送请求$http并得到一些响应,之后我必须更新页面并调用timer函数:
$http({method: 'POST', url: url_api, data: {login_username: username, login_password: password}}).success(function(data, status, headers, config) {
// parse data
....
window.location.replace("/");
// call timer
timer();
}
哪里timer:
function timer(){
document.getElementById("span_count_down").innerHTML = 'Time is out!';
return;
}
但是当我更新页面时,我没有看到Time is out!,innerHTML我看到了以前innerHTML的。
谢谢你。