HTML元刷新不会去的URL
问题描述:
我用这要问的页面每10秒后刷新,在CGI shell脚本:HTML元刷新不会去的URL
pid=$!
if [[ `ps -p $pid | wc -l` -gt 1 ]]
then
output="Program is running. Running time depends on the number of alternatively spliced proteins the submitted gene has. Results will be displayed here."
echo "<html>"
echo "<head>"
echo "<meta http-equiv="refresh" content="10;URL='http://XXX/gene-to-structure/navnav.gif'"/>"
echo "</head>"
echo "<body>"
echo "<table width="750" border="0" cellspacing="0" cellpadding="0">"
echo "<tr><td><img src=\"../../images/calc.gif\" align=\"absmiddle\"> <strong> $output </strong></td></tr>"
echo "</table>"
echo "</body>"
echo "</html>"
fi
但它不带我去“URL” 。 10秒后,它刷新到同一页面。你能不能让我知道什么可能是错的?非常感谢!
答
看起来像引用问题,这是令人震惊的,因为在bash中几乎没有发生过。 :-)尝试是这样的:
echo "<meta http-equiv=\"refresh\" content=\"10;URL='http://XXX/gene-to-structure/navnav.gif'\"/>"
,看看是否让你更接近。检查浏览器正在接收的HTML是确认您是否生成了您想要的确切HTML的简单场所。
+0
谢谢!它的工作原理,但它后到URL,它不会刷新?我期待它每10秒刷新一次,直到“$ pid”是“-gt”1.请让我知道问题可能是什么?我试图做的是,当程序在后台运行时,浏览器每10秒钟用给定的URL刷新一次,并且当程序在后台结束时,URL会消失,输出将显示在元数据的网页中刷新网址被给出。谢谢。 – Dipak
您可以在浏览器中使用Ctrl-U来捕获并发布您的浏览器从此脚本接收的确切HTML吗? –