1

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

eg:when using

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

url must encode

2

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.