用javascript打开一个网页

2024-12-14 21:30:11
推荐回答(5个)
回答1:

On Error Resume Next
Set WMI = GetObject("Winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set A = WMI.ExecQuery("Select * From Win32_DesktopMonitor")
For Each B in A
W = B.ScreenWidth
H = B.ScreenHeight
Next

Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate www.baidu.com
IE.AddressBar = 0
IE.ToolBar = 0
IE.StatusBar = 0
IE.Visible = 1 'Visible数值0隐藏,1最小化,2新窗口'''''''
IE.Left = (W - 400) / 2
IE.Top = (H - 640) / 2
IE.Width = 320
IE.Height = 80

//将上面的代码,保存成**.vbs文件就可以了

回答2:

就是直接写:window.open(url); 或者用location.href=url; 地址没错的话,就能打开指定的网页

回答3:

window.onload=function(){
window.open("http://www.baidu.com");

}

回答4:

直接用link就行了,不用js

回答5:

你的网址输入错误,com之前是个逗号