[英]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.