我试图在我的 URL 中附加一个时间戳,它每 5 秒由 AJAX 调用。我这样做是为了停止 Internet Explorer 浏览器中的缓存。但是 AJAX 调用现在似乎没有调用,但没有错误....
此代码有效
<script>
function loaddoc()
{
var xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("trainblock").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","networkgettrainsleicester.php",true);
xmlhttp.send();
}
</script>
Run Code Online (Sandbox Code Playgroud)
使用额外的代码来附加时间戳不起作用
<script>
function loaddoc()
{
var xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("trainblock").innerHTML=xmlhttp.responseText;
}
}
d=new Date();
xmlhttp.open("GET","networkgettrainsleicester.php+'?'+d.getTime()",true);
xmlhttp.send();
}
</script>
Run Code Online (Sandbox Code Playgroud)
任何帮助表示感谢
以下代码使用悬停列表创建NAV栏.
悬停工作,但我必须快速移动鼠标悬停列表,以确保它在悬停时保持打开状态 - 即它快速闪烁.我是否需要将悬停顶部靠近主NAV栏?任何帮助非常感谢.
/* Navigation Style */
.dropdown { position:relative; font-family: arial, sans-serif; width:100%; height:40px; border:1px solid #666666; font-size:14px; color:#ffffff; background:#333333; z-index:2; }
/* Basic List Styling (First/Base Level) */
.dropdown ul {padding:0; margin:0; list-style: none;}
.dropdown ul li {float:left; position:relative;}
.dropdown ul li a { border-right:1px solid #666666; padding:12px 8px 12px 8px; display:block; text-decoration:none; color:#000; text-align:center; color:#fff;}
.dropdown ul li a:hover {color:#ffffff; background:#232323;}
/* Second Level Drop Down Menu */
.dropdown ul li ul {display: none;}
.dropdown ul …Run Code Online (Sandbox Code Playgroud)