尝试打开添加到文本栏的 link 时出现错误 403,如何自动更新图像?
Error 403 when trying to open link added to text bar and how auto update the images?
我正在使用 Notepad++ 创建脚本。
当我尝试从文本栏和激活按钮打开 link 时,它提供了 403 error
,但是当我直接在 <iframe src="INDICATED LINK"
中设置值并打开 HTML
没有出现此错误,它在 iframe 中完美打开。
我还想知道如何每 0.5 秒 仅更新名称为 name="Graphic1"
、name="Graphic2"
和 [=] 的 img
18=]。我如何将对 iframe
的调用(不需要每 0.5 秒刷新一次)与对 img
的调用(需要每 0.5 秒自动刷新一次)分开?
脚本:
<html>
<head>
<script language="JavaScript"><!--
function refreshIt() {
if (!document.images) return;
document.images['Gráfico1'].src = chart1.value;
document.images['Gráfico2'].src = chart2.value;
document.images['Gráfico3'].src = chart3.value;
iframe1.action = chart4.value;
iframe2.action = chart5.value;
iframe3.action = chart6.value;
setTimeout(refreshIt,500); // refresh every 0.5 secs
}
//--></script>
</head>
<body onLoad=" setTimeout(refreshIt,500)">
<input type="text" id="chart1" name="chart1"><br>
<input type="text" id="chart2" name="chart2"><br>
<input type="text" id="chart3" name="chart3"><br>
<input type="text" id="chart4" name="chart4"><br>
<input type="text" id="chart5" name="chart5"><br>
<input type="text" id="chart6" name="chart6"><br>
<p></p>
<form method="post" target="iframe1">
<input type="submit" value="I Frame 1" />
<form method="post" target="iframe2">
<input type="submit" value="I Frame 2" />
<form method="post" target="iframe3">
<input type="submit" value="I Frame 3" />
</form>
<iframe name="iframe1" width="350" height="282"></iframe>
<iframe name="iframe2" width="350" height="282"></iframe>
<iframe name="iframe3" width="350" height="282"></iframe>
<p></p>
<img src="https://logospng.org/download/betfair/logo-betfair-fundo-laranja-1024.png" name="Gráfico1">
<img src="https://logospng.org/download/betfair/logo-betfair-fundo-laranja-1024.png" name="Gráfico2">
<img src="https://logospng.org/download/betfair/logo-betfair-fundo-laranja-1024.png" name="Gráfico3">
</body>
</html>
iframe
的预期结果类似于(此结果是我使用 <iframe src = https://sports.staticcache.org/scoreboards/scoreboards-football/index.html?eventId=21081122
时得到的结果):
我认为你的问题是你写得不好 link 它应该像 https://xtsd.betfair.com/..。而不像 https://sporthttps//xtsd.betfair.com/... 你现在写的那样。
关于刷新图像,您可以这样做:
setInterval(() => {
document.images["Gráfico1"].src = chart1.value
document.images["Gráfico2"].src = chart2.value
document.images["Gráfico3"].src = chart3.value
}, 500)
我正在使用 Notepad++ 创建脚本。
当我尝试从文本栏和激活按钮打开 link 时,它提供了 403 error
,但是当我直接在 <iframe src="INDICATED LINK"
中设置值并打开 HTML
没有出现此错误,它在 iframe 中完美打开。
我还想知道如何每 0.5 秒 仅更新名称为 name="Graphic1"
、name="Graphic2"
和 [=] 的 img
18=]。我如何将对 iframe
的调用(不需要每 0.5 秒刷新一次)与对 img
的调用(需要每 0.5 秒自动刷新一次)分开?
脚本:
<html>
<head>
<script language="JavaScript"><!--
function refreshIt() {
if (!document.images) return;
document.images['Gráfico1'].src = chart1.value;
document.images['Gráfico2'].src = chart2.value;
document.images['Gráfico3'].src = chart3.value;
iframe1.action = chart4.value;
iframe2.action = chart5.value;
iframe3.action = chart6.value;
setTimeout(refreshIt,500); // refresh every 0.5 secs
}
//--></script>
</head>
<body onLoad=" setTimeout(refreshIt,500)">
<input type="text" id="chart1" name="chart1"><br>
<input type="text" id="chart2" name="chart2"><br>
<input type="text" id="chart3" name="chart3"><br>
<input type="text" id="chart4" name="chart4"><br>
<input type="text" id="chart5" name="chart5"><br>
<input type="text" id="chart6" name="chart6"><br>
<p></p>
<form method="post" target="iframe1">
<input type="submit" value="I Frame 1" />
<form method="post" target="iframe2">
<input type="submit" value="I Frame 2" />
<form method="post" target="iframe3">
<input type="submit" value="I Frame 3" />
</form>
<iframe name="iframe1" width="350" height="282"></iframe>
<iframe name="iframe2" width="350" height="282"></iframe>
<iframe name="iframe3" width="350" height="282"></iframe>
<p></p>
<img src="https://logospng.org/download/betfair/logo-betfair-fundo-laranja-1024.png" name="Gráfico1">
<img src="https://logospng.org/download/betfair/logo-betfair-fundo-laranja-1024.png" name="Gráfico2">
<img src="https://logospng.org/download/betfair/logo-betfair-fundo-laranja-1024.png" name="Gráfico3">
</body>
</html>
iframe
的预期结果类似于(此结果是我使用 <iframe src = https://sports.staticcache.org/scoreboards/scoreboards-football/index.html?eventId=21081122
时得到的结果):
我认为你的问题是你写得不好 link 它应该像 https://xtsd.betfair.com/..。而不像 https://sporthttps//xtsd.betfair.com/... 你现在写的那样。
关于刷新图像,您可以这样做:
setInterval(() => {
document.images["Gráfico1"].src = chart1.value
document.images["Gráfico2"].src = chart2.value
document.images["Gráfico3"].src = chart3.value
}, 500)