Reputation: 16845
I am using symfony framework to develop web site. Symfony recognize ajax call by XMLHttpRequest header.
I have integrated Gmap on my page. Gmap making ajax request without XMLHttpRequest header.So symfony doesn't recognize ajax request.
Normal jquery ajax call have this header.
X-Requested-With XMLHttpRequest
But Gmap doesn't add this.
GDownloadUrl(searchUrl, function(data) {
var xml = GXml.parse(data);
...
}
The GDownloadUrl makes this ajax call. How can i add this header with it.
Upvotes: 1
Views: 202
Reputation: 16845
I solved my problem by replacing GDownloadUrl function by jquery.get function.
jQuery.get('searchUrl',function(data) {
var xml = GXml.parse(data);
...
}
This function attaches XMLHttpRequest header
Upvotes: 1