I am using jquery 1.3.2 and have the following code,
$("document").ready(function () {
$.ajax({
url: "/ViewBuilder/GetView",
data: {
rId: $("#R_Id").val()
},
type: "POST",
success: function (data) {
if (data !== undefined) {
var rep = JSON.parse(data);
if (rep.ViewObjects !== undefined) {
for (var ro in rep.ViewObjects) {
$.ajax({
url: "/ViewBuilder/ViewObject",
type: "POST",
contentType: "application/json",
data: JSON.stringify({
Id: ro,
TypeId: rep.ViewObjects[ro].TypeId,
SourceId: rep.ViewObjects[ro].SourceId,
Ordinal: rep.ViewObjects[ro].Ordinal,
ViewId: rep.ViewObjects[ro].ViewId
}),
success: function (data) {
if (data !== undefined) {
$('.View-content #column1').append(data)
}
}
});
}
}
}
}
});
});
I have this ajax call fired twice,
i have used jQuery only once. The document is loaded only once and have seen a lot of Q & A here.. it has beaten my days. kindly point out the buggy code in this fragment, i have literally run out of any ideas than posting here.
EDIT
Is there any way in chrome developer tool to find which ajax calls are triggered by what event, so that i can find the root cause for these kind of events.
Try debugging with console.log().
You can then see the output in the chrome developers tool console tab.
Hope this helps!