参数列表后面的Uncaught SyntaxError:missing) [英] Uncaught SyntaxError: missing ) after argument list

查看:276
本文介绍了参数列表后面的Uncaught SyntaxError:missing)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我正在尝试使用按钮触发JavaScript功能,但它不起作用。

我设法从Chrome JavaScript控制台中找出的唯一错误是:



Hey, I'm trying to trigger a JavaScript function with a button, but it doesn't work.
The only error I managed to figure out from the Chrome JavaScript console is this one :

Uncaught SyntaxError: missing ) after argument list         vacAdmin:204





似乎该功能无法识别。



嗯,这是我的功能:





It also seems that the function doesn't get recognized.

Well and this is my function :

function editRecord(idVac, title, location, reference, duration, buisness, task, commencement, interest, contractType, salary, func, requirements, employmenttype, employmentlevel){

        var vacform = document.createElement("form");
        vacform.setAttribute("name", "form");
        vacform.setAttribute("method", "post");
        vacform.setAttribute("action", "/vacChangeBox");

        var vacancyId = document.createElement("input");
        vacancyId.setAttribute("type", "hidden");
        vacancyId.setAttribute("name", "vacancyId");
        vacancyId.setAttribute("value", idVac);
        vacancyId.setAttribute("value", title);
        vacancyId.setAttribute("value", location);
        vacancyId.setAttribute("value", reference);
        vacancyId.setAttribute("value", duration);
        vacancyId.setAttribute("value", buisness);
        vacancyId.setAttribute("value", task);
        vacancyId.setAttribute("value", commencement);
        vacancyId.setAttribute("value", interest);
        vacancyId.setAttribute("value", contractType);
        vacancyId.setAttribute("value", salary);
        vacancyId.setAttribute("value", func);
        vacancyId.setAttribute("value", requirements);
        vacancyId.setAttribute("value", employmenttype);
        vacancyId.setAttribute("value", employmentlevel);

        vacform.appendChild(vacancyId);
        var csrf = document.createElement("input");
        csrf.setAttribute("type", "hidden");
        csrf.setAttribute("name", "${_csrf.parameterName}");
        csrf.setAttribute("value", "${_csrf.token}");
        //append crsf
        //apepend element
        vacform.appendChild(csrf);


        document.body.appendChild(vacform);
        //submit form
        vacform.submit();



    }







功能由此按钮触发:






The function get triggered by this button :

<td><input data-vacIdEdit="${vac.id}" type="button" name="Bearbeiten" value="Edit" onclick="editRecord(${vac.getId()},${vac.getTitel()},${vac.getLocation()},${vac.getReferenceCode()},${vac.getDuration()},${vac.getBuisnessTravel()},${vac.getTasks()},${vac.getCommencement()},${vac.getInterestGroup()},${vac.getContractType()},${vac.getSalary()},${vac.getFunctionality()},${vac.getRequirements()},${vac.getEmploymentType()},${vac.getEmploymentLevel()});"></td>





有什么建议可能出错吗?



提前致谢



Any suggestions what could be wrong ?

Thanks in advance

推荐答案

{_ csrf.parameterName});
csrf.setAttribute( value
{_csrf.parameterName}"); csrf.setAttribute("value", "


{_ csrf.token});
// 追加crsf
// apepend元素
vacform.appendChild(csrf);


document .body.appendChild(vacform);
// 提交表单
vacform.submit();



}
{_csrf.token}"); //append crsf //apepend element vacform.appendChild(csrf); document.body.appendChild(vacform); //submit form vacform.submit(); }







功能由此按钮触发:






The function get triggered by this button :

<td><input data-vacIdEdit="


{vac.id} 类型 = 按钮 名称 = Bearbeiten value = 编辑 onclick = editRecord(
{vac.id}" type="button" name="Bearbeiten" value="Edit" onclick="editRecord(


这篇关于参数列表后面的Uncaught SyntaxError:missing)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆