开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜