title: JSON Parse Error on Internet Explorer
body: <p>I'm using a jscript to retrieve JSON data from Flickr. Works 100% in every browsers except IE.<br>
  I'm using the jquery each function that calls this specific function for IE:  </p>
  
  <pre><code>//some code
  if ($.browser.msie &amp;&amp; window.XDomainRequest) {    
    var xdr;  
    var url = "http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&amp;api_key=" + apiKey + "&amp;photoset_id=" + set + "&amp;extras=url_sq&amp;format=json&amp;nojsoncallback=1";  
    xdr = new XDomainRequest();
    if (xdr) {  
      xdr.open("get", url);  
      xdr.send();   
      var data = JSON.parse(xdr.responseText);
      //some jquery stuff
    }
  }
  </code></pre>
  
  <p>In IE the function return's a syntax error in the <strong>var data = JSON.parse(xdr.responseText);</strong> but the error is random, it retrieves a random number of photos before showing the error..</p>
  
  <p>I've checked all the variables involved and everything is returning OK.</p>
  
  <p>I'm using the json2.js</p>
  
  <p>UPDATE:  </p>
  
  <p>JSON possible results:  </p>
  
  <pre><code>{
      "photoset": {
          "id": "72157627083924637",
          "primary": "5943107169",
          "owner": "63570294@N03",
          "ownername": "motorespt.com",
          "photo": [
              {
                  "id": "5943107169",
                  "secret": "e6099e3936",
                  "server": "6029",
                  "farm": 7,
                  "title": "Peugeot 206",
                  "isprimary": "0",
                  "url_sq": "http://farm7.static.flickr.com/6029/5943107169_e6099e3936_s.jpg",
                  "height_sq": 75,
                  "width_sq": 75
              }
          ],
          "page": 1,
          "per_page": 500,
          "perpage": 500,
          "pages": 1,
          "total": "1"
      },
      "stat": "ok"
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>{"stat":"fail", "code":1, "message":"Photoset not found"}
  </code></pre>
  
  <p>UPDATE:<br>
   thanks to all the help i was able to find the error and make a function compatible with IE 7+, Firefox, Chrome, etc..</p>
  
  <pre><code>function flickr_test(){
    var apiKey = 'YOUR_API_KEY';
    $.ajax({
      url: 'http://api.flickr.com/services/rest/',
      data: {
          method: 'flickr.test.echo',
          api_key: apiKey, 
          format: 'json',
          test: 'test string',
          jsoncallback: 'jsonFlickrApi'
      },
      dataType: 'jsonp'
    });
  }
  function jsonFlickrApi(response){
    console.log(response.stat);
  }  
  </code></pre>
  
  <p>P.S.: the 'test' var is string that i wanted to pass to the callback function</p>