我有window.open()问题吗?

时间:2015-06-26 22:11:22

标签: javascript

好吧,所以我有这个功能,使用window.open为我开帐户,但问题是它记录"窗口打开" 但之后它没有&#39 ;记录任何内容,没有错误,并且它不会创建帐户。任何人都可以想到它为什么会这样做?

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')

1 个答案:

答案 0 :(得分:1)

你似乎在混合" jQuery" ( char array[length]; //Where length should be a constant integer )与"不是jQuery" (.val()

不要这样做。