0

如何将以下脚本放入 liferay 主题的 portal_normal.vm 中。

<script type="text/javascript"> 
    var $old = $.noConflict();
</script>

我已经以与上面所示相同的方式编写了它。但它抛出了错误。我错过了什么吗?

09:03:38,440 ERROR [velocity:151] org.apache.velocity.exception.ParseErrorException: Encountered ")" at my-theme_SERVLET_CONTEXT_/templates/portal_normal.vm[line 24, column 33]
Was expecting one of:
    <EOF> 
    "(" ...
    <RPAREN> ...
    <ESCAPE_DIRECTIVE> ...
    <SET_DIRECTIVE> ...
    "##" ...
    "\\\\" ...
    "\\" ...
    <TEXT> ...
    "*#" ...
    "*#" ...
    <STRING_LITERAL> ...
    <IF_DIRECTIVE> ...
    <STOP_DIRECTIVE> ...
    <INTEGER_LITERAL> ...
    <FLOATING_POINT_LITERAL> ...
    <WORD> ...
    <BRACKETED_WORD> ...
    <IDENTIFIER> ...
    <DOT> ...
    "{" ...
    "}" ...
4

1 回答 1

0

您试图在 Liferay 主题中避免 jQuery 冲突。而不是使用 $.noConflict() 你可以使用

<script type="text/javascript"> 
    var old = jQuery.noConflict();
</script>
于 2012-10-26T10:53:26.670 回答