开发者

did javascript or jquery has method as Server.UrlEncode() in asp.net

did javascript or jquery has method as Se开发者_高级运维rver.UrlEncode() in asp.net

eg:when using

  $.get("a.aspx?pk=1&k="+kvale, function(data) {
            dosth(data);
            });

url must encode


You can convert any string to a URL-encoded string (suitable for transmission as a query string or, generally speaking, as part of a URL) using the JavaScript functions escape, encodeURI and encodeURIComponent.

escape('https://www.stackoverflow.com/?wow.php')
"https%3A//www.stackoverflow.com/%3Fwow.php"

Source: http://www.javascripter.net/faq/escape.htm

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜