[英]I'm having window.open() problems?
好的,因此我具有使用window.open為我創建帳戶的功能,但問題是它記錄了“ Window open”,但此后它不記錄任何內容,沒有錯誤並且也沒有創建該帳戶。 有人能想到它這樣做的原因嗎?
var accountPassword = "testPassword512"
function checkUsername(username, callback) {
$.get("http://www.roblox.com/UserCheck/DoesUsernameExist?username=" + username, function(data) {
callback(data.success); // true = taken , false = not taken
});
};
function makeNewAccount(accountName) {
checkUsername(accountName, function(response) {
if (response == false) {
console.log("Making account: " + accountName)
signupWindow = window.open("http://www.roblox.com/login/signup.aspx");
console.log("Window opened");
signupWindow.document.getElementById('SignupUsername').val(accountName);
signupWindow.document.getElementById('SignupPassword').val(accountPassword);
signupWindow.document.getElementById('SignupPasswordConfirm').val(accountPassword);
signupWindow.document.getElementById("birthdayMonthSelect").value = 0;
signupWindow.document.getElementById("birthdayDaySelect").value = 0;
signupWindow.document.getElementById("birthdayYearSelect").value = 25;
console.log("done with values");
signupWindow.document.getElementByClassName('.gender-circle').click();
console.log("done choosing gender");
signupWindow.document.getElementById('SignUpButton').submit();
console.log("account made");
} else {
return true; // true = account taken , false = not taken
}
});
}
makeNewAccount('240213mfasd')
您似乎正在將“ jQuery”(. .val()
)與“ not jQuery”(. .value =
)混合在一起
不要那樣做
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.