好了,我回到这个不执行的地方了,我在php中有如下内容https://deniserose.000webhostapp.com/fetch_sql.php
<head>
<title>Audio Stream</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
我在php文件末尾加载了java脚本
<script src = 'js/fetch_updater.js'></script>
现在这似乎永远也跑不动了
// Start Clock refresh
// uses new new Ajax.PeriodicalUpdater(
// in main fetch file to trigger the auto update of the page.
// Written by Denise Rose
var gUpdateDiv="";
var gContentURL="";
var gcheckInterval=0;
var gcheckURL = "";
var gCurrentCheck ="";
_fetchUpdater('track_data','/fetch_sql.php','/fetch_sql.php',6000);
function _fetchUpdater(updateDiv,contentURL,checkURL,checkInterval)
{
gUpdateDiv = updateDiv;
gContentURL = contentURL;
gcheckInterval = checkInterval;
gCheckURL = checkURL;
setTimeout('Check();',gcheckInterval);
}
//Called by _fetchUpdater every (n) seconds determines if content should be updated as page loaded.
function Check()
{
new Ajax.Request(gCheckURL,{method:'get', onSuccess:CheckResponse});
setTimeout('Check();',gcheckInterval);
}
// looks for the response and determines if the div should be updated.
var openFile = function(event) {
var input = event.target;
var reader = new FileReader();
reader.onload = function(){
var text = reader.result;
var node = document.getElementById('output');
node.innerText = text;
console.log(reader.result.substring(0, 200));
};
reader.readAsText(input.files[0]);
};
function CheckResponse(transport)
{
var content = transport.response.Text;
var base64file1 = openFile('/images/nowplaying-artwork_2.png');
var base64file2 = $('outerimg').$('#np_track_artwork').src.value;
if(base64file1 != base64file2) {
//if(gCurrentCheck != content) {
gCurrentCheck = content;
new Ajax.Request(gContentUrl, {method: 'get',onSuccess:function t() {
$(gUpdateDiv).innerHTML = t.responseText; /*t.response.json()*/}
});
$time = new Date().getTime();
new Ajax.Request('outer_img', {method: 'get',onSuccess:function s() {
$('outer_img').innerHTML = "<img id='#np_track_artwork' src='/images/nowplaying_artwork_2.png?t='"+$time+" alt='Playing track artwork' width='200' height='200'>"}
});
}
//setTimeout('Check();',gcheckInterval);
}
它应该在images/nowplaying_artwork_2.png上查看网站上的图像,并使用javascript和ajax调用检查其是否与屏幕上的图像一致。我知道目录中的那个正在更改,但据我所知,它永远不会被激活,除非你刷新整个页面。使用crtl+shift-i。一定是我做错了什么?但我不明白为什么它不执行。你能帮忙吗?这像目录位置一样愚蠢吗?
我在麻省理工学院原型javascript框架1.7.2版中发现了这个错误
(c) 2005-2010山姆·斯蒂芬森
这就是[violation]“settimeout”处理程序占用296299ms prototype.js的时间
function delay(timeout) {
var __method = this, args = slice.call(arguments, 1);
timeout = timeout * 1000;
return window.setTimeout(function() {
return __method.apply(__method, args);
}, timeout);
}
好的,我看了代码检查,它确实运行checkresponse(),它需要非推断,不像settimeout(),有人能帮忙吗,因为它没有进一步的进展,它可能是我的base64东西,但需要帮助吗?有没有可能我读的Java代码不起作用?拥抱谢谢你的关注:d
暂无答案!
目前还没有任何答案,快来回答吧!