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
精彩评论