Javascript语法问题 - 找到它

Jos*_*he4 1 html javascript

我有以下javascript代码段,由于缺少而无法加载; 在使用searchUserInfo的urr声明之前的语句之前..我有双重和三重检查此代码

function submitUserInfo(username) {

    url = "edit_user.php?cmd=submitinfo&username="+username+"&firstname="+document.userForm.firstname.value+"&lastname="+document.userForm.lastname.value+"&flaggedauctions="+document.userForm.flaggedauctions.value+"&lastauction="+document.userForm.lastauction.value+"&street1="+document.userForm.street1.value+"&city1="+document.userForm.city1.value+"&postcode1="+document.userForm.postcode1.value+"&street2="+document.userForm.street2.value+"&city2="+document.userForm.city2.value+"&postcode2="+document.userForm.postcode2.value+"&phone="+document.userForm.phone.value+"&mobilephone="+document.userForm.mobilephone.value+"&fax="+document.userForm.fax.value+"&email="+document.userForm.email.value+"&website="+document.userForm.website.value+"&bank="+document.userForm.bank.value+"&banknumber="+document.userForm.banknumber.value+"&accountnumber="+document.userForm.accountnumber.value+"&comments="+document.userForm.comments.value;

    var xmlHttp=GetXmlHttpObject(); //you have this defined elsewhere

    //if(xmlHttp.responseText == 'true') {

        xmlHttp.open("GET",url,true);

        xmlHttp.send(null);

        updateByUser(username);

    //}

}

function searchUserInfo() {

    url = "get_results.php?cmd=SearchUserData&searchstring="+document.searchForm.search.value"&subcat="+subcat;

    var xmlHttp=GetXmlHttpObject(); //you have this defined elsewhere

    //if(xmlHttp.responseText == 'true') {

        xmlHttp.open("GET",url,true);

        xmlHttp.send(null);

        update('Layer3', url);

    //}

}
Run Code Online (Sandbox Code Playgroud)

我使用过jslint,看不清楚是什么,如果有什么变化的话.没有错误.我正在使用萤火虫,但它并没有帮助我.

Gum*_*mbo 7

你忘记了一个+操作员.这个:

url = "get_results.php?cmd=SearchUserData&searchstring="+document.searchForm.search.value"&subcat="+subcat;
Run Code Online (Sandbox Code Playgroud)

应该:

url = "get_results.php?cmd=SearchUserData&searchstring="+document.searchForm.search.value+"&subcat="+subcat;
Run Code Online (Sandbox Code Playgroud)