0
誰でもこのコードが動作しない理由を教えてください。私はアラートを得ることさえできません()。 init()ですべての質問に対して、本当に申し訳ありませんが、もう一度...私のJavascriptコードに問題があります
window.onload = init;
var downloadedstuff;
function init() {
alert();
$.get('example.php' + '?v=' + Math.random(), success: function (data) {
downloadedstuff = data;
});
doTimer();
}
var t;
var timer_is_on=0;
function timedCount()
{
$.get('example.php' + '?v=' + Math.random(), success: function (data) {
if(data != downloadedstuff)
{
alert('SOMETHING HAPPENED!!!!');
location.reload(true);
}
else
{
alert(data);
}
});
t=setTimeout("timedCount()",5000);
}
function doTimer()
{
if (!timer_is_on)
{
timer_is_on=1;
timedCount();
}
}
を正しく動作するために、私は間違っているのか分かりません。
オブジェクトjavascriptのためのものですので、は()のようにエラーが発生しますアラートにはパラメータとして文字列が必要です。 – Eineki
IE9ではなく、少なくとも、私は文字列を追加します:P – MatthewSot