我在Ruby中有以下代码.我想将此代码转换为JavaScript.什么是JS中的等效代码?
text = <<"HERE"
This
Is
A
Multiline
String
HERE
Run Code Online (Sandbox Code Playgroud) 无法找到我的问题的解决方案所以我会在这里问.
当我插入jQuery文件时,我在第2行遇到错误:意外的令牌ILLEGAL
码:
jQuery(document).ready(function(){
$('body').append('
<div id="style_selector">
<div id="style_selector_container">
// another chunk of code
</div><!-- #style_selector end -->');
});
Run Code Online (Sandbox Code Playgroud)
先感谢您
所以我想写一个函数来返回列表元素,其中包含很少的东西,即
function generateSurpriseMe(month) {
var surprise = $('
<li class="queue-month">
<h3>'+ month +'</h3>
...
</li>
');
return surprise;
}
Run Code Online (Sandbox Code Playgroud)
其中month是一个需要插入的参数(它不是唯一的参数,但为了保持这个简单,我只会包含它).但我在控制台中收到"意外令牌ILLEGAL"错误,无法弄清楚它是什么,错误推荐给第二行代码var surprise = $('