I am developing an application that use jQuery to make ajax calls to the server.
When I analyze the traffic with Fiddler I can see, as in the following picture, that I have many strange calls to an undefined URL. My code does not make those kind of calls that seems to be generated randomly.
Is there any way to discover where the call comes from? How can I troubleshoot this situation?
EDIT:
This is a sample ajax call
$.ajax({
url: '<%= SPContext.Current.Site.Url %>' + wsBaseUrl + 'DashboardWS.asmx/MyMethod',
type: "post",
async: false,
dataType: "json",
data: JSON.stringify({ customerID: customerid, companyID: companyID }),
contentType: "application/json; charset=utf-8",
success: function (data) {
result = data.d;
}
});
EDIT 2:
Many people that has tried to help suppose that, at some time, the wsBaseUrl
variable become undefined
and so I can get the error showed in the screenshot. In my opinion, while this seems reasonable to me, it's not completely correct: as you can see in the sample ajax call posted, even if wsBaseUrl
would be undefined
at some time the resultant url shall not be /sites/shp/undefined
but /sites/shp/undefined/DashboardWS.开发者_JAVA百科asmx/MyMethod
. I am in fact concatenating three strings...
EDIT 3:
Following EricLaw suggestion I have tried and obtained the following result:
URL Method Result Type Received Taken Initiator Wait Start Request Response Cache read Gap
/sites/shp/undefined GET 404 0.57 KB 1.00 s appendChild <frame> 5469 93 782 125 0 3687
but appendChild
that's not in my code !!!
精彩评论