The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Hey everyone! I unfortunately have to work with someone else's coding on this new project. I get a parse error every time I try to put this into my headinclude. I don't know this type of code. Can anyone tell me what is wrong with it?
Thanks! Code:
<script type="text/javascript"> $(document).ready(function(){ $('#mainMenu > li').hover( function() { $(this).addClass('hover') }, function() {$(this).removeClass('hover')}); }); </script> |
#2
|
||||
|
||||
![]()
Parse error when you try to save the template from vBulletin? Could you post the full error?
|
#3
|
||||
|
||||
![]()
Sure. It gives me this error....
The following error occurred when attempting to evaluate the template 'headinclude': Parse error: syntax error, unexpected '(', expecting T_VARIABLE or '$' in /var/www/vhosts/am-tech.org/httpdocs/community/includes/adminfunctions_template.php(3939) : eval()'d code on line 56 This is likely caused by a malformed conditional statement. |
#4
|
||||
|
||||
![]()
Ah, yes, I see the the error now. The vBulletin template parser is interpreting "$(this)" (+ others) as a PHP variable, which it is not. (The error is thrown because it contains characters that are deemed invalid in a PHP variable.) Try this instead:
HTML Code:
<script type="text/javascript"> \$(document).ready(function(){ \$('#mainMenu > li').hover( function() { \$(this).addClass('hover') }, function() {\$(this).removeClass('hover')}); }); </script> |
#5
|
||||
|
||||
![]()
Yeay!! That worked! Thanks so much!
![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|