Forums / General / Backslash quotes in a text

Backslash quotes in a text

Author Message

Christian BELLET

Tuesday 29 July 2008 8:47:39 am

Hello,
I have to return a string in a javascript function but I need to escape quotes with backslashes..

For instance :

document.write('blabla there's a quote here');

would return an error.

Can you tell me which function should I use ?

Thanks

Christian BELLET

Tuesday 29 July 2008 9:03:56 am

Ok, here is the workaround.
I just remember I did it in the past

In template.ini.append.php

<?php /* #?ini charset="utf-8"?

[PHP]
PHPOperatorList[]
PHPOperatorList[urlencode]=urlencode
PHPOperatorList[addslashes]=addslashes

*/ ?>