0

How to put below script inside portal_normal.vm of liferay theme.

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

i have written it in the same way as shown above. But it is throwing below error. Am i missing something?

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> ...
    "{" ...
    "}" ...
R Shah
  • 171
  • 4

1 Answers1

0

You are trying to avoid jQuery Conflict in your Liferay theme. Instead of using $.noConflict() you can use

<script type="text/javascript"> 
    var old = jQuery.noConflict();
</script>
  • I don't think that releases the $ variable. I am running into this same problem. All the above shows is that old now represents the jQuery variable not necessarily that $ is freed for use by other libraries – Jesse Kinsman May 10 '13 at 16:26