Javascript 如何将此coffeescript转换为js/jquery? text=child.html() text=text.replace/(#包括(\s**)?)/gi,$1' text=text.replace/(main\(.*)/gi,$1' child.html文本
这是我的问题的答案:我不知道如何使用coffeescript,而回答的人看起来不可用 来自Javascript 如何将此coffeescript转换为js/jquery? text=child.html() text=text.replace/(#包括(\s**)?)/gi,$1' text=text.replace/(main\(.*)/gi,$1' child.html文本,javascript,jquery,coffeescript,Javascript,Jquery,Coffeescript,这是我的问题的答案:我不知道如何使用coffeescript,而回答的人看起来不可用 来自 var文本; text=text.replace(/(#include(\s*)?)/gi,$1'); text=text.replace(/(main\(.*))/gi,$1'); html(文本); 是一个翻译站点,您只需在函数调用(html和replace)中添加paradensis语法错误缺少操作数。@BarbaraLaird该站点所做的与此处所需相反…@Oleh-有两个选项卡,您可以任意选择 t
var文本;
text=text.replace(/(#include(\s*)?)/gi,$1');
text=text.replace(/(main\(.*))/gi,$1');
html(文本);
是一个翻译站点,您只需在函数调用(html和replace)中添加paradensis语法错误缺少操作数。@BarbaraLaird该站点所做的与此处所需相反…@Oleh-有两个选项卡,您可以任意选择
text = child.html()
text = text.replace /(#include(\s*<.*>)?)/gi, '<span>$1</span>'
text = text.replace /(main\(.*\))/gi, '<span>$1</span>'
child.html text
var text;
text = text.replace(/(#include(\s*<.*>)?)/gi, '<span>$1</span>');
text = text.replace(/(main\(.*\))/gi, '<span>$1</span>');
child.html(text);