我正在使用一些erb通过jQuery附加到页面。当我拿出erb out(image_tag)时页面工作正常,但是没有正确加载它。我是否正确添加它?
我得到的控制台错误是:
Uncaught SyntaxError: missing ) after argument list
代码示例:
$('#stops').append(
"<div class='bus-item-header col-xs-12'>" +
"<%= image_tag('compass.png') %>" +
"<h2>" + stop.MonitoredVehicleJourney.PublishedLineName +
"</h2>" + "<br>" + "<span class='line-info'>"+
currentStopOBA.name + "<br>" +
"TO: " + busDestinationRegex + "<br>" + "<br>" + "</span>"
+ "</div>" +
"<div class='bus-item col-xs-12'>" + busDistanceAway + "<br>" +
busStopsAway + " stops away" + "<p>" + "</div>"
);
非常感谢任何和所有帮助!