单击colorbox上的按钮后调用ajax

单击colorbox上的按钮后调用ajax,ajax,jquery,colorbox,Ajax,Jquery,Colorbox,我在firefox(版本:14.0.1)上遇到以下错误,当我在点击colorbox上的按钮后调用ajax时 错误:NS\u错误\u XPC\u错误\u转换\u JS:无法转换JavaScript参数 下面是我的代码: 当我点击一个按钮时,下面的函数被调用 function addIdentifierManually(moduleName, pageNumber){ $.colorbox({ html : "<strong>"+moduleName+" :<

我在firefox(版本:14.0.1)上遇到以下错误,当我在点击colorbox上的按钮后调用ajax时

错误:
NS\u错误\u XPC\u错误\u转换\u JS:无法转换JavaScript参数

下面是我的代码: 当我点击一个按钮时,下面的函数被调用

function addIdentifierManually(moduleName, pageNumber){
    $.colorbox({
        html : "<strong>"+moduleName+" :</strong><input class='text "+moduleName+"Text' id='identifier' value=''>"
               +"<br/><br/><center><input type='button' value='Insert' onclick='insertIdentifier("+moduleName+","+pageNumber+")'/></center>",
        width : '300px',
        height : '200px',

    });
}
我在哪里失踪?任何帮助都是值得的

你能试试这个吗:

function addIdentifierManually(moduleName, pageNumber) {
    $.colorbox({
        html : "<strong>"+moduleName+" :</strong><input class='text "+moduleName+"Text' id='identifier' value=''>"
               +"<br/><br/><center><input type='button' value='Insert' id='insertIdent' /></center>",
        width : '300px',
        height : '200px',

    });

    $("#insertIdent").bind('click', insertIdentifier(moduleName,pageNumber));
}
函数addIdentifier手动(模块名称,页码){
$彩色盒({
html:“+moduleName+:”
+“

”, 宽度:“300px”, 高度:“200px”, }); $(“#insertIdent”).bind('click',insertIdentifier(moduleName,pageNumber)); }
你不是100%正确。u'r解决方案不等待用户输入。当颜色框打开时,它只触发ajax。但你给了我方向,解决了我的问题$(“#insertIdent”).bind('click',function(){insertIdentifier(moduleName,pageNumber,$('#insertIdent').val();});
function addIdentifierManually(moduleName, pageNumber) {
    $.colorbox({
        html : "<strong>"+moduleName+" :</strong><input class='text "+moduleName+"Text' id='identifier' value=''>"
               +"<br/><br/><center><input type='button' value='Insert' id='insertIdent' /></center>",
        width : '300px',
        height : '200px',

    });

    $("#insertIdent").bind('click', insertIdentifier(moduleName,pageNumber));
}