【发布时间】:2014-10-27 04:19:18
【问题描述】:
我在 chrome 上使用 Tampermonkey 并在网站上运行它。我正在尝试使用登录凭据登录。我得到它来单击注销,而不是登录。这是我的整个代码:
// ==UserScript==
// @name Blah
// @namespace Blah.com
// @description .
// @include http://Blah.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
// ==/UserScript==
//function logOut()
//{
// Log out of Blah
// Blah = document.getElementsByName(“Blah");
// for i in 1..2 do
// log in
// //username = Username1
// password = Password1
// {
// {
// greyButtons.click();
// }
// }
//}
function logOut()
{
// Log out of Blah incase already signed in
document.getElementById('Blah').click();
}
logOut();
function logIn()
{
document.getElementById("Header_Login_tbUsername")
//I don't know what to put here
}
logIn();
【问题讨论】:
-
另见 stackoverflow.com/questions/16029674/… 以了解 AJAX 驱动的页面(也适用于静态页面)。
标签: javascript google-chrome login tampermonkey