我做了一個運行和完美的作品一個VBScript,以爲我可以只需將其與腳本代碼的HTML,它會執行相同。不正確的,請告訴我,我需要做的就是按鈕的工作。作爲一個腳本會自動登錄並導航到一個頁面,我希望當按下我的網頁上一個按鈕,這樣的事情發生。我以爲我的VBScript按鈕會執行,但我可能失去了一些東西
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Add a Lead</title>
<script type="text/vbscript">
function Execute()
{
Dim IE
Dim WRI
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = 1
IE.navigate "http://rentalapp.zillow.com/"
Do While (IE.Busy)
WScript.Sleep 10
Loop
Set WRI = IE.document.getElementByID("username")
WRI.Value = "username"
Set WRI = IE.document.getElementByID("password")
WRI.Value = "password"
Set WRI = IE.document.Forms(0)
WRI.Submit
WScript.Sleep 801
IE.navigate "http://rentalapp.zillow.com/leads/add/"
document.getElementById("field2").value=document.getElementById("field1").value; } </script> </head>
<body>
<button onclick="Execute()">Add A Lead</button>
</body>
</html>
請幫助
花括號和分號不是在VBScript有效語法元素。另外,「不起作用」是不充分的問題描述。怎麼*確切*做它「不工作」?你有錯誤嗎? –