How to retrieve a value from a url using jquery

How to retrieve a value from a url using jquery

Hi ,

in my application i want to load a page using jquery and same time i want to pass a value and return a result.

i used following query

  1.  var id= $('#ContentPlaceHolder1_txtstid').val();
                 $('#disp').show();
                 $('#disp').load("GuardianForm.aspx?id="+id);.

my requirement is in guardianForm.aspx ,retrive value of id.

as per the value of id i want to return a result.

following is code in GuardianForm.aspx

  1. $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "GuardianForm.aspx/BindGuardian",
                    data: "{id:'"+id+"'}",
                    dataType: "json",
                    success: function (data) {
                        $('#txttitle').val(data.d[0].title);
                        $('#txtsname').val(data.d[0].surname);
                       
    
                    }
                });


How it is possible

Regards

Baiju