title: Dashboard Cross-domain AJAX with jquery
body: <p>Hey everyone, I'm working on a widget for Apple's Dashboard and I've run into a problem while trying to get data from my server using jquery's ajax function. Here's my javascript code:</p>
  
  <pre><code>$.getJSON("http://example.com/getData.php?act=data",function(json) { 
      $("#devMessage").html(json.message)
      if(json.version != version) {
          $("#latestVersion").css("color","red")
      }
      $("#latestVersion").html(json.version)
  })
  </code></pre>
  
  <p>And the server responds with this json:</p>
  
  <pre><code>{"message":"Hello World","version":"1.0"}
  </code></pre>
  
  <p>For some reason though, when I run this the fields on the widget don't change. From debugging, I've learned that the widget doesn't even make the request to the server, so it makes me think that Apple has some kind of external URL block in place. I know this can't be true though, because many widgets phone home to check for updates.</p>
  
  <p>Does anyone have any ideas as to what could be wrong?</p>
  
  <p>EDIT: Also, this code works perfectly fine in Safari.</p>
  
  <p><hr />
  As requested by Luca, here's the PHP and Javascript code that's running right now:</p>
  
  <p>PHP:</p>
  
  <pre><code>echo $_GET["callback"].'({"message":"Hello World","version":"1.0"});';
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>function showBack(event)
  {
  var front = document.getElementById("front");
  var back = document.getElementById("back");
  
  if (window.widget) {
      widget.prepareForTransition("ToBack");
  }
  
  front.style.display = "none";
  back.style.display = "block";
  stopTime();
  if (window.widget) {
      setTimeout('widget.performTransition();', 0);
  }
  $.getJSON('http://nakedsteve.com/data/the-button.php?callback=?',function(json) { 
      $("#devMessage").html(json.message)
      if(json.version != version) {
          $("#latestVersion").css("color","red")
      }
      $("#latestVersion").html(json.version)
  })
  }
  </code></pre>