- I'm at Starbucks (3020 Hwy 121 N., at Glade, Euless) http://4sq.com/gn7iGL #
- I'm at Starbucks (3020 Hwy 121 N., at Glade, Euless) http://4sq.com/eVlMf8 #
- @missrogue If you get caught between the Moon and New York City
The best that you can do ……
The best that you can do is fall in love #
Twitter Weekly Updates for 2011-01-23
- I'm at Houlihan's (401 Interstate 20 E, Arlington) w/ 2 others http://4sq.com/fxut2B #
- I'm at LSG Sky Chefs (6191 N. State Highway 161, Irving) http://4sq.com/eVEiMs #
- I'm at Starbucks (3020 Hwy 121 N., at Glade, Euless) w/ 2 others http://4sq.com/i7lOXQ #
Twitter Weekly Updates for 2011-01-16
- I'm at Starbucks (3020 Hwy 121 N., at Glade, Euless) http://4sq.com/i2sgKj #
- I'm at Starbucks (3020 Hwy 121 N., at Glade, Euless) http://4sq.com/gkdMkt #
- I'm at Starbucks (3020 Hwy 121 N., at Glade, Euless) http://4sq.com/gB5VDP #
- I'm at Starbucks NE Mall (1324 Pipeline Rd., Melbourne, Hurst) http://4sq.com/e5tgiO #
Twitter Weekly Updates for 2011-01-09
- I'm at Starbucks (3020 Hwy 121 N., at Glade, Euless) http://4sq.com/e0cxjT #
- I just unlocked the "Fresh Brew" badge on @foursquare! http://4sq.com/eB6nUR #
- Work. (@ LSG Sky Chefs) http://4sq.com/g2xxvt #
- Dinner. (@ BJ's Restaurant & Brewhouse) http://4sq.com/eYyI1D #
Jersey + Jsonp + jQuery
At work we are developing an application that required me to create a webservice that could be called from another domain with javascript. Hopefully this will help you do just that. I am using Jersey 1.4 and jQuery 1.4.4.
Here is my Jersey java code for the webservice:
package com.test;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.GenericEntity;
import com.sun.jersey.api.json.JSONWithPadding;
@Path("/test")
public class Test {
@GET
@Path("/jsonp")
@Produces("application/javascript")
public JSONWithPadding testJSONP(@QueryParam("jsoncallback") String callback{
String retVal="YES";
return new JSONWithPadding(
new GenericEntity("{"test":"" + retVal + ""}"){},callback);
}
}
You can see what gets returned by pasting in the browser
http://localhost:8080/test/jsonp
It should return: callback({“test”:”YES”})
Now to make this call in jQuery:
$.ajax({
url: 'http://0.0.0.0:8080/test/jsonp', //Sub the 0.0.0.0:8080 to the ip or name of where the webservice is located.
type: 'GET',
dataType: 'jsonp',
jsonp: 'jsoncallback',
success: function(data){
alert(data.test);
}
});
Twitter Weekly Updates for 2011-01-02
- I'm at Super Target (1400 Precinct Line Rd, Hurst) http://4sq.com/g7zWiY #
- I'm at Super Target (1400 Precinct Line Rd, Hurst) http://4sq.com/eoW5dm #
- I'm at Starbucks (3020 Hwy 121 N., at Glade, Euless) http://4sq.com/ecWU67 #
- I'm at Red Hot & Blue http://4sq.com/hE0Q08 #