Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何将此coffeescript转换为js/jquery? text=child.html() text=text.replace/(#包括(\s**)?)/gi,$1' text=text.replace/(main\(.*)/gi,$1' child.html文本_Javascript_Jquery_Coffeescript - Fatal编程技术网

Javascript 如何将此coffeescript转换为js/jquery? text=child.html() text=text.replace/(#包括(\s**)?)/gi,$1' text=text.replace/(main\(.*)/gi,$1' child.html文本

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

这是我的问题的答案:我不知道如何使用coffeescript,而回答的人看起来不可用

来自

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*&lt;.*&gt;)?)/gi, '<span>$1</span>'
text = text.replace /(main\(.*\))/gi, '<span>$1</span>'
child.html text
var text;

text = text.replace(/(#include(\s*&lt;.*&gt;)?)/gi, '<span>$1</span>');

text = text.replace(/(main\(.*\))/gi, '<span>$1</span>');

child.html(text);