The below way I call my pageload function by jQuery.
Please tell me how to pass query string.
<script type="text/javascript" src="script/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#Customers').change(function() {
$.ajax({
contentType: "text/html; charset=utf-8",
data: "CustomerID=" + $('#Customers').val(),
url: "FetchCustomer.aspx",
dataType: "html",
success: function(data) {
$("#CustomerDetails").html(data);
}
});
});
});
</script>
I have a few questions like
-
when type: “POST”, then contentType: “application/json; charset=utf-8”,
has to be application/json? it can not be html? -
when type: “POST” then url can’t be like url: “Customer.aspx?ID=101/FetchCustomer”
I mean I can not then pass query string.
Guide me please. Thanks
GETandPOSThas nothing to do withcontentTypeyou can setcontentType:"html"withtype:"POST"when you set the
type:"POST"the form values are not visible in the query string likewww.utopia.com?name=john&lastName=smithREF: http://www.cs.tut.fi/~jkorpela/forms/methods.html#fund