0

I use the following code:

<div id="success"></div>
<script>$.getJSON('http://daytona.bg/test.html', function(data) { $(data.html).appendTo("#success"); } );</script>

The script is loading and appending but only if the test.html is on my computer. If it's on a external domain - it's not working.

How can it be done?

1 Answers1

0

You'll need to use JSONP, the cross-domain version of JSON to get data from external domain.

Here is a link with a lot of useful information: jQuery AJAX cross domain

Community
  • 1
  • 1
E.J. Brennan
  • 45,870
  • 7
  • 88
  • 116