View Full Version : JSONP request redirects

25 Oct 2010, 10:39 PM
I'm using following code to get tweets using JSONP and show onto map. However, when I click on the button to execute this code, rather than showing it on to the map, page redirects to the location. The code is as follows:

url: 'http://search.twitter.com/search.json',
callbackKey: 'callback',
params: { geocode: gcode},
callback: function (data) {
if (data.results) {
for (var i = 0; i < data.results.length; i++) {
var items = data.results[i];
location = items.location.replace('\u00dcT: ', '');
//split coordinates from location
coords = location.split(',');
latitude = coords[0];
longitude = coords[1];
// create new marker
marker = new google.maps.Marker({
position: new google.maps.LatLng(latitude, longitude),
//icon: '../resources/icons/flag_32.png',
map: iMap