Javascript : catch( err )

I had a bug with piwik.

Stats doesn’t count, but javascript code well inserted into html page.

Firefox error console writes :


Erreur : missing { before catch block
Code Source :
} catch( err )

So, I find how to solve on the web :


"replace "catch(err) {}" with "catch(err) { }"

The space makes the difference :P "

So, I write how to do, If someone as the same problem. Here is the answer.

Sorry for my poor english,

You must be inserting the code into a template

For example, with smarty, wrap the code in {literal}…{/literal} tags

Yes I inserted into overall_header.tpl, in the header.
It was missing a space between { } into the line :
catch(err) { }
when you add this missing space, all workds fine.

before to solve my problem, I read on a forum to wrap the code in {literal}…{/literal} tags, but doesn’ work.

Now, all works fine, I write this tip is someone has the same problem.