Wednesday, 15 June 2011

replace - Using encodeURIComponent in XPages -



replace - Using encodeURIComponent in XPages -

in w3schools give example:

var uri = "http://w3schools.com/my test.asp?name=ståle&car=saab"; var res = encodeuricomponent(uri);

which want however, when run error encodeuricomponent not implemented.

try{ var str:string = "contracts , leases"; var rtn = encodeuricomponent(str); }catch(e){ println(e) }

added above button not implemented error. there equivalent need replace spaces %20s.

use java.net.urlencoder.encode(stringtoencode, "utf-8") in case this:

try{ var str:string = "contracts , leases"; var rtn = java.net.urlencoder.encode(str, "utf-8"); }catch(e){ println(e) }

replace xpages xpages-ssjs encodeuricomponent

No comments:

Post a Comment