vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Template Parser Acting Stupid... (https://vborg.vbsupport.ru/showthread.php?t=231636)

Trek 12-30-2009 12:25 AM

Template Parser Acting Stupid...
 
I posted this on vb.com but realized I should probably be asking here.

Anyone know why I would be getting this error:

Code:

Parse error:  syntax error, unexpected '[' in /home/XXXXXXXXXXXX/includes/adminfunctions_template.php(4597) : eval()'d code on line 72
When I have this text in a template:
Code:

function removeElement (e) {
    var li = e.parentNode;
    li.parentNode.removeChild(li);
}

I've narrowed it down to just the one line causing this template not to save:

Code:

var li = e.parentNode;
If you create a new template and just put the above function in it and try to save, you'll see what I mean.

Thanks for your help!

Lynne 12-30-2009 02:42 AM

I already answered on your thread at vb.com. You should put <vb:literal> tags around javascript until they fix the issue regarding the { and var in the script.

Trek 12-30-2009 03:13 AM

Yup, got it Lynne. Works good, thank you as always!

Jafo232 12-30-2009 06:04 PM

I found escaping them works too..

Code:

function removeElement (e) \{

derfelix 12-31-2009 02:51 AM

Quote:

Originally Posted by Jafo232 (Post 1942748)
I found escaping them works too..

Code:

function removeElement (e) \{

yes.. but can you predict how that will work once they fix the bug???
I feel safer with lynne's solution
F.


All times are GMT. The time now is 05:03 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01619 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete