我创建 WordPress ShortCode 选项卡并编写此代码来收集简码
jQuery('body').on('click', '#tapSubmit',function(){
    var shortcode = '[tapWrap]';
    jQuery('.tapForm').each(function(){
        var title = jQuery('.Title').val(),
            content = jQuery('.Content').val(),
            shortcode += '[tap ';
        if(title){shortcode += 'title="'+title+'"';}
        shortcode += ']';
        if(content){shortcode += ''+content+'';}
        shortcode += '[/tap]';
    });
    shortcode += '[/tapWrap]';
    tinyMCE.activeEditor.execCommand('mceInsertContent', false, shortcode);
});
我得到这个错误
Uncaught SyntaxError: Unexpected token if 
我尝试了http://jsfiddle.net/中的代码,我在有此代码的行中遇到了这个错误
shortcode += '[tap ';
Expected an assignment or function call and instead saw an expression.
如何解决?