Question

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.

Was it helpful?

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)); 

OTHER TIPS

You could try the Querystring class provided by Adobe I used in this answer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top