{% block reviewresult %}
<div class="scrollerList">
</div>
{% endblock %}
{% block myJavascript %}
<script>
var stateObject = {};
var title = "Single";
var urlEncode = "'" +{{ tag|url_encode(true) }} + "'";
alert(urlEncode);
var newUrl = baseUrl + "/taglist/" + urlEncode.toString();
$(document).ready(function() {
ShuffleObj.changeUrl(stateObject, title, newUrl);
ffleObj.setScrollUrl(baseUrl + '/taglist/playlist/' + urlEncode.toString());
});
</script>
{% endblock %}
上面的代码var urlEncode = "'" +{{ tag|url_encode(true) }} + "'";
显示错误
SyntaxError: identifier 在 numeric literal 之后立即开始。在这个问题中,标签值为tag= 123 Forever;