Cornelis
Cornelis

Reputation: 909

Trying to use JSON with jQuery

I'm trying to get json working using jQuery 1.4.1 but I'm getting a null object.

Here's an example of not working code: (using $.ajax which has the 'success:' )

$.ajax({
    url: 'http://isohunt.com/js/json.php',
    dataType: 'json',
    success: function(data) {
        alert('Worked');
        alert(data);
    }
});

What is wrong with this code?

Thanks in advance

Upvotes: 0

Views: 398

Answers (1)

Jan Dudulski
Jan Dudulski

Reputation: 843

You cannot ajax cross domain. You have to make proxy instead, inside your domain. Check http://www.google.com/search?q=ajax+cross+domain

Upvotes: 3

Related Questions