JSON JQeury API and Hudson

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

JSON JQeury API and Hudson

Jakob Andersen
Hi,

I'm trying to access the JSON api og hudson with jqeury. I am using
the following piece of javascript code:

 jQuery.getJSON("http://bp-hudson:8070/job/Booking/2123/api/json",
                function(data) {
                var buildStatus = data;

});

As I'm totally new to jquery and json i wonder if i'm missing
something. When I type in the url in my browser i print out the json
string perfectly.

Any ideas?


/Jakob
Reply | Threaded
Open this post in threaded view
|

RE: JSON JQeury API and Hudson

martin.loiselle@medrium.com
This post has NOT been accepted by the mailing list yet.
On vacation:
I will be out of the office starting the Dec. 23rd and
will return on January 10.

for any problem related to your email or computer, please send an email to [hidden email].

For any emergency, call at 1-418-264-6911
Reply | Threaded
Open this post in threaded view
|

Re: JSON JQeury API and Hudson

Julian Simpson
In reply to this post by Jakob Andersen

On 27 Dec 2010, at 13:18, Jakob Andersen <[hidden email]>  
wrote:

> As I'm totally new to jquery and json i wonder if i'm missing
> something. When I type in the url in my browser i print out the json
> string perfectly.
>

I used the ajax function on my radiator (xfd.build-doctor.com), with  
the 'jsonp' option set.  I think you'll also need to set the jsonp  
parameter in the URL ('?jsonp=?').

It's worth reading up on jsonp.  It works when you browse the URL  
because it's just displaying the data.  An Ajax call  to the same url  
could end up running malicious code, which is why the browser won't  
play ball.

Hth,

J.

> Any ideas?
>
>
> /Jakob
Reply | Threaded
Open this post in threaded view
|

RE: Re: JSON JQeury API and Hudson

martin.loiselle@medrium.com
This post has NOT been accepted by the mailing list yet.
On vacation:
I will be out of the office starting the Dec. 23rd and
will return on January 10.

for any problem related to your email or computer, please send an email to [hidden email].

For any emergency, call at 1-418-264-6911