Here I've came across using WCF service and it's RESTclient in same application. But I have a question that, is there any way to restrict the url parameter of Ajax to view in browser's Page Source or console f12?

Here is simple Example:

<script type="text/javascript">
    var D = document;

    //get data function
    function getyearData() {
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: 'Service1.svc/GetYears',
            dataType: "json",
            //async: false,
            success: function (data) {
                var a = data.GetYearsResult.Data;
                var response = $.parseJSON(a);
                var ddl = D.getElementById('ddlYears');
                var opt = D.createElement("option");
                opt.text = '--Select--';
                opt.value = 0;
                for (i = 0; i < response.length; i++) {
                    opt = D.createElement("option");
                    opt.text = response[i]['holiday_date'];
                    opt.value = response[i]['holiday_date'];
            error: function (data) {
                alert('Error Occured');

And, this function is able to view in Browser using ways mentioned above. Any possible way to hide the script tags or at least url in Ajax call, in ASP.NET, JQuery?

Related posts

Recent Viewed