The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Problem adding javascript to template
Hello
Might be a bug (but couldnt find the bug reporting stuff on vbulletin.com) But probably its just stupid me.. that cant write javascript... I want to edit a template (any template) and add a simple javascript: HTML Code:
<script type="text/javascript"> function checkme() { var test='test'; } </script> Quote:
if i add javascript other than var x = ''; or something.. it works... I could write var test="test"; outside of the function... that works... but no point in having a function then... i found the parse error in adminfunctions_template.php on line 4516 it does eval($template) so i added ... print $template;exit; and on that line it does: function checkme() ' . htmlspecialchars($test=test . ' which gives the parse error... Now my question. Is there a simple way to add my function? thanks for any help Felix [EDIT] Found a workaround, not very elegant.. but works for me... maybe it helps someone else.. HTML Code:
<script type="text/javascript"> function checkme() { var test='test'; } </script> but: HTML Code:
<script type="text/javascript"> var test=''; function checkme() { test='test'; } </script> works... seems that the parse error is triggered by the var inside a function... strange.. |
#2
|
||||
|
||||
It is a known bug in the template parser.
|
#3
|
|||
|
|||
thanx
for your reply Felix |
#4
|
|||
|
|||
surround the javascript with
Quote:
|
#5
|
|||
|
|||
thx
works! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|