Search code examples
flashinternet-explorergoogle-chromeactionscriptgeturl

How do I use a question mark in Actionscript 2.0 with getURL function?


Actionsctipt code:

on(press)
{
     getURL(escape("address.html?0"));
}

This works absolutely fine in Internet Explorer but in Chrome in the question mark is obviously made into "%3F".

Any ideas how I can stop this from happening and still keep it compatible with IE and other popular browsers?

Thanks.


Solution

  • As mgraph says in his comment, you shouldn't escape the entire URL, simply do:

    getURL("address.html?0");
    

    If your real URL (guessing "address.html?0" is a simplified example) has parts that needs to be escaped, then you would want to escape those parts only, to avoid having the ? and similar being escaped. So for example like this:

    var userName:String = "Lars Blåsjö";
    getURL("page.html?name=" + escape(userName));