Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

url encoding using Flex navigatetoUrl function

I want to post data to a URL on my server from a Flex app. im using the following

UrlParam = UrlParam + '&name='+ name.text + '&business=' + buisness.text;
navigateToURL(new URLRequest(UrlParams),'_self');

the problem im having however is that if i enter a business with an ampersand ("A&b.com") then the name does not send.

Does Flex have anything out of the box to do the encoding from & to %26?

like image 598
cdugga Avatar asked Dec 22 '22 11:12

cdugga


1 Answers

Use encodeURIComponent() to encode each parameter.

UrlParam = UrlParam + '&name=' + encodeURIComponent(name.text) + 
  '&business=' + encodeURIComponent(buisness.text);    
navigateToURL(new URLRequest(UrlParams),'_self');
like image 55
mweiss Avatar answered Dec 30 '22 14:12

mweiss