Javascript obfuscate AJAX code <p>First of all sorry if the name of the topic isn't the most correct.</p> <p>Imagine the following code which connects to a PHP file by AJAX.</p> <pre><code>function get_locales(){ var the_locale = $('#page-add-text').val(); var url = "classes/load_info.php?type=locale&amp;value=" + the_locale; var all = ""; $.getJSON(url, function(data){ $.each(data, function(index, item){ all += "&lt;li data-name='" + item.value + "'&gt;&lt;/li&gt;"; }); $("#page-add-listview").html(all); $("#page-add-listview").trigger("change"); $("#page-add-listview").listview("refresh"); }); } </code></pre> <p>If people download the page, they will see <code>classes/load_info.php?type=locale&amp;value= + the_locale;</code> With this they automatically assume that the url is: <code>www.stackoverflow.com/classes/load_info.php?type=locale&amp;value=TESTING;</code></p> <p>So, they can view/retrieve what the function prints, plus, they might try to get some bugs. I'm asking for help in know-how of best ways (if there is any..) to avoid this.</p> <p>Thank you.</p>