导航:首页 > 编程语言 > 刷新网页代码

刷新网页代码

发布时间:2021-04-04 01:11:38

java刷网页代码

在页面中加入js代码
<script type="text/javascript">
function a(){
setTimeout(b()',10*1000); //时间间隔为毫秒,此处为10秒执行一次
}
function b(){
var url = "xxxx";//发送请求的url地址
window.location.href = url;
//或者用window.locatoin.reload();
}
</script>

② 网页刷新代码怎么用

在网页 A 中最后面加上代码:
<iframe width="0" height="0" src="B.htm" name="网页B"></iframe>
在网页 B 中<head>与</head>之间加上:
<meta http-equiv="refresh" content="8">
content="8" 表示 8 秒刷新一次!~
上面假设了 网页 B 为:B.htm

③ 每隔多少秒刷新网页的代码急

XMLHTTP我使用了确实存在这样的问题,在进程没结束前结果永远不变
不过我找到了解决方案,我没你那么快,我是5分钟,5分钟旧的程序自动退出前启动一个新的进程,这样就可以刷新了,我已经使用了三个多月,只要计算机开着都实时刷新,处理代码,效果非常理想,望采纳,谢谢!

以下是VBS代码:
========edit1.vbs=========
Dim s, t, fso, w

Set w = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")

s = GetCode("GB2312", "")
's是代码,在这里处理

wscript.sleep 5000
w.run "wscript.exe """ & wscript.scriptfullname & """"

Public Function BytesToBstr(strBody, CodeBase)
Dim ObjStream
Set ObjStream = CreateObject("Adodb.Stream")
With ObjStream
.Type = 1
.Mode = 3
.open
.write strBody
.Position = 0
.Type = 2
.Charset = CodeBase
BytesToBstr = .ReadText
.Close
End With
Set ObjStream = Nothing
End Function

Public Function GetCode(CodeBase, Url)
Dim xmlHTTP1
Set xmlHTTP1 = CreateObject("Microsoft.XMLHTTP")
xmlHTTP1.open "get", Url, True
xmlHTTP1.send
While xmlHTTP1.readyState <> 4
wscript.sleep 100
Wend
GetCode = xmlHTTP1.responseBody
If CStr(GetCode) <> "" Then GetCode = BytesToBstr(GetCode, CodeBase)
Set ObjXML = Nothing
End Function

④ 网页延时3秒刷新页面 的代码是多少

两种方法:

1.在<head><head>里加入以下代码(间隔5秒刷新网页):
<meta http-equiv="Refresh" content="5">

2.用js脚本实现(间隔5秒刷新网页):
function refreshPage()
{
window.location.reload();
window.setTimeout("refreshPage()",5000);
}

refreshPage();

补充:
function refreshPage()
{
window.location.reload();
}

window.setTimeout("refreshPage()",3000);

⑤ 帮忙做个自动刷新网页的代码。

使用webBrowser控件。
Private Sub Command1_Click()
If InStr(1, WebBrowser1.LocationURL, "http://www.shishicai.cn/Lottery/Speed/FCCQSSC/Trend/bz3x_zs_dxjo.aspx", vbTextCompare) > 0 Then '请在此修改你要刷新的内部网页的地址
WebBrowser1.Refresh '刷新
End If
End Sub

⑥ 关于网页自动刷新代码

如何让页面只复自动刷新制一次

记得<meta>标签当中有一个refresh的功能吗?这是让浏览的页面刷新并可以转到相应的页面,如果刷新本页的话就会造成重复的刷新,现在我们就试试用脚本来实现只让页面刷新一次.

1.看看下面这段代码

<Script>
function reurl(){

url = location.href; //把当前页面的地址赋给变量 url

var times = url.split("?"); //分切变量 url 分隔符号为 "?"

if(times[1] != 1){ //如果?后的值不等于1表示没有刷新

url += "?1"; //把变量 url 的值加入 ?1

self.location.replace(url); //刷新页面

}
}

onload=reurl

</script>

2.原理

充分利用地址栏可带参数的选项,用脚本来取得页面间的传递参数,并不需要后台程序的支持。

⑦ 求代码:能每五分钟刷新的网页代码。。。急。。。

<script>
<!--
var limit="3:00"

if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}

function beginrefresh(){
if (!document.images)
return
if (parselimit==1)
window.location.reload()
else{
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
if (curmin!=0)
curtime=curmin+" min "+cursec+" sec "
else
curtime=cursec+" sec "
window.status=curtime
setTimeout("beginrefresh()",1000)
}
}

window.onload=beginrefresh
//-->
</script>

加到body中间,这里是3:00为三分钟,可以自定

⑧ bat编程,刷新指定网页 (求代码)

On Error Resume Next

Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate "http://bbs.bathome.net"
IE.Visible = 1
'''''''Visible数值0隐藏,1新窗口'''''''

Wscript.Sleep 5000
Set O = IE.Document
Do While True
Wscript.Sleep 20000
O.Location.Reload(True)
If Err <> 0 Then
Wscript.Quit
End If
Loop

⑨ 网页的刷新(F5)用html代码写是什么

代码如下:

<input type=button value=刷新 onclick="history.go(0)">

代码如下:

<input type=button value=刷新 onclick="location.reload()">

代码如下:

<input type=button value=刷新 onclick="location=location">

代码如下:

<input type=button value=刷新 onclick="window.navigate(location)">

代码如下:

<input type=button value=刷新 onclick="location.replace(location)">

阅读全文

与刷新网页代码相关的资料

热点内容
bim咨询网站有哪些 浏览:187
梦幻西游戒指怎么升级 浏览:658
转转app买的手机怎么退 浏览:36
数据结构如何删除图的某一条边 浏览:514
剪映导入本地视频找不到文件夹 浏览:17
plc工控板可以哪些编程 浏览:372
车屏设备号在哪里文件夹里 浏览:817
你当前设定的版本 浏览:758
jshtml生成图片插件下载链接 浏览:907
mavenjava开发 浏览:759
找不到c盘exe文件 浏览:420
破解googleplay教程 浏览:421
体质数编写程序 浏览:700
苹果6s手机证券换不了输入法 浏览:18
涂料网站模版 浏览:106
戴尔笔记本文件夹改名 浏览:759
电脑关机文件excel未保存 浏览:421
做商品的app有哪些 浏览:881
javaswf动画 浏览:143
哪些文件名称是有用的 浏览:211

友情链接