我遇到了window.open()问题

I'm having window.open() problems?

本文关键字:问题 open window 遇到      更新时间:2023-09-26

好的,所以我有这个函数,它使用 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 = ( 混合在一起

别这样。