PDA

View Full Version : urlEscape deprecated in 4.3 use encodeURIComponent


dwilliams
04-21-2009, 09:39 AM
Hello forum.

Has anyone had an issue with lz.BrowserService.encodeURIComponent(str : String).

Running 4.3, I get a INFO in debug stating that urlEscape is deprecated use encodeURIComponent. But when I use encodeURIComponent, I get a method not found error.

Also, urlEscape does return a encoded string.

Below is a working test case.

<canvas debug="true" width="800" height="640">
<handler name="oninit">
var string1 = "Hello Foo";
var string2 = "Bye Bar";
var oldCleanURL = lz.Browser.urlEscape(string1);
var cleanURL = lz.Browser.encodeURIComponent(string2);
var cleanURL2 = lz.BrowserService.encodeURIComponent(string2);

if($debug)
{
Debug.write(oldCleanURL);
Debug.write(cleanURL);
Debug.write(cleanURL2);
}
</handler>
</canvas>

senshi
04-21-2009, 02:48 PM
"encodeURIComponent()" is a global function.

dwilliams
04-22-2009, 04:22 AM
Thanks, that's a nice to know.
The documentation doesn't state it's a global function...
http://www.openlaszlo.org/lps4.3/docs/reference/lz.BrowserService.html

Also, is there a list of global function any where in the documentation?

Thanks for you help.
-Daniel

senshi
04-22-2009, 10:32 AM
"encodeURIComponent(..)" is defined in ECMAScript Language Specification (http://www.ecma-international.org/publications/standards/Ecma-262.htm).