PDA

View Full Version : Template Parser Acting Stupid...


Trek
12-30-2009, 12:25 AM
I posted this on vb.com but realized I should probably be asking here.

Anyone know why I would be getting this error:

Parse error: syntax error, unexpected '[' in /home/XXXXXXXXXXXX/includes/adminfunctions_template.php(4597) : eval()'d code on line 72When I have this text in a template:
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:

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..

function removeElement (e) \{

derfelix
12-31-2009, 02:51 AM
I found escaping them works too..

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.