Hi,
I'm facing a unique problem of firefox and i.e
when I passed a function from $.AJAX with datatype as JSON then that function (provided in url with some parameter) will not execute
Note :- I'm using both onclientclick event and button click event on the same button
And when I'm debugging from firefox by placing breakpoint inside $.ajax, then that function which I passed inside $.AJAX will execute first.
Tell me why this is happening and what is the solution of this typical problem.
Here is some snippet which is not working properly:-
.aspx file
<asp:Button ID="btnSubmit" Text="Proceed" runat="server" OnClientClick="myFunction();"
OnClick="btnSubmit_Click" />
Javascript code is:-
function myFunction() {
$.ajax({
type: "POST",
url: "pageName.aspx/CallFunction",
data: "{'valArray': '" + JSON.stringify(variable) + "'}",
contentType: "application/json",
dataType: "json",
success: function () {
},
error: function () {
}
});
}
P.S :- In google Chrome it is working perfectly
Thanks in Advance