Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  8] [ 7]  / answers: 1 / hits: 22181  / 13 Years ago, thu, december 8, 2011, 12:00:00

I am using jquery for all my ajax thing, I don't know if that is fine but I use that for now.

I have one text input when user type characters in it I call server side get some values and add them on the view.

Code that I use bellow works fine but I want to improve it a little.

How can I make this ajax call so that users that want to investigate my page source code can't see what I call here?

So basically I want to hide from page source what url, what type and data send I use here, is it possible?



$(function () {
$(#txtSearch).keyup(function (evt) {
$.ajax({
url: /Prethors/Users/SearchUsers,
type: POST,
data: text= + this.value,
success: function (result) {
$(#searchResult).prepend(<p> + result + </p>);
}
});
});
});

More From » asp.net-mvc

 Answers
290

No, a user will always be able to figure out what calls you are making if you include it in javascript.



You can compress and minify the javascript, but a determined person will always be able to find your url calls.



Here's a js compression site, for example.
http://jscompress.com/


[#88659] Wednesday, December 7, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lucillemariselal

Total Points: 108
Total Questions: 97
Total Answers: 119

Location: Thailand
Member since Thu, May 6, 2021
3 Years ago
;