Best way to pass Url to another page
I have pass url to another page via javascript .For example www.example.com/share.php?url=http://googl开发者_运维百科e.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 .
Use the encodeURIComponent
function before your url.
精彩评论