I am creating a simple application for the Mobile to retrieve netflix information via AJAX request with json. This works perfectly well on the browser.
I am having a problem triggering the success of the ajax request. I have been reading and searching every where but no solution has fixed my issue on the device (emulator, ultimately the android). I am using Phonegap.
Here is are my CDNs:
<script src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.js"></script>
<script src="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.js"></script>
and here is my code:
var myMoviePeopleURL = "http://odata.netflix.com/Catalog/People?$top=200&$format=json&$callback=?";
$.ajax({
dataType: 'jsonp',
url: myMoviePeopleURL,
success: function () {alert('Success');},
error: function (jqXHR, textStatus, errorThrown) {
alert(textStatus);
alert(errorThrown);
},
});
I receive a parse error and function not called. The device is fired up before the document so it is not a internet issue. I have checked this. It seems to either be a syntax issue or a compatibility issue (with the device).
Reminder: I need this to work on the device. Browser works just fine with this code.
Any help is much appreciated. Thank you!
I have spoken with another application developer at my workplace and he claimed to have found a bug in the Netflix API. He has emailed them. Like I had said earlier, this phonegap application worked fine on the phone with Blockbusters BBYOpen.
Thanks again for your help guys!