# Passing a variable with quotes to Javascript

**URL:** <https://forum.kirupa.com/t/passing-a-variable-with-quotes-to-javascript/288119>\
**Category:** flash\
**Created:** [May 11, 2009, 3:34pm UTC](https://forum.kirupa.com/t/passing-a-variable-with-quotes-to-javascript/288119 "2009-05-11T15:34:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![colouredFunk](https://avatars.discourse-cdn.com/v4/letter/c/a8b319/32.png) [@colouredFunk](https://forum.kirupa.com/u/colouredFunk)\
**Post date:** [May 11, 2009, 3:34pm UTC](https://forum.kirupa.com/t/passing-a-variable-with-quotes-to-javascript/288119/1 "2009-05-11T15:34:16Z")

</div>

Hi,

I’m trying to send a string from flash to javascript. The string can contain anything, from XML to quotes, symbols etc…

I’ve URL encoded the string, eg :

var u:URLRequest = new URLRequest(“javascript:showEditor(‘hello%20%27%3Cbr%20/%3E’)”);  
navigateToURL(u,"\_self");

but it I’m still getting an error in firefox:  
Syntax error - showEditor('hello ‘\<br /\>’)

Can anyone shed some light on this please.

Many thanks
