views:

59

answers:

1

I have pass url to another page via javascript .For example www.example.com/share.php?url=http://google.com/ (I create whole url via javascript , I add my url variable to static string (which is www.example.com/share.php?url= ) and I redirect user to this page). But while I am passing url variable to share script , special characters(ğüşiöç) in url change or disappear. What should I do to Url string to keep it unchanged .

+3  A: 

Use the encodeURIComponent function before your url.

Sarfraz