Try the following:
Code: Select all
<script type="text/javascript">
var r="{TOPIC_TITLE}";
[your code goes here]
</script>
Explication:
1) The second parenthesis you used into the variable is round: phpbb template vars need
curly brackets for both opening and closing vars;
2) The {TOPIC_TITLE} is just "a placeholder". for a string value and will be parsed by phpbb parser on the server and replaced with the corresponding string got form the DB so you must insert it into quotes or it will generate an invalid code that could fire an error.
Also
at this address it is possible to find the source of this tutorial (in ita) with an image reporting a working example result. Hope it helps.