I am building a mobile app with Phonegap, using jquery.xdomainajax.js for parsing html elements from a url (another domain). The tutorial I’m following is here.
My application runs well in a web browser, but when I try it on android device was not running.
I’ve tried changing super.setIntegerProperty (“loadUrlTimeoutValue”, 70000); from MyPhoneGapActivity.java, but still failed.
and this my index.html
<script type="text/javascript" charset="utf-8" src="cordova-1.9.0.js"></script>
<script type="text/javascript" charset="utf-8" src="jquery.mobile/jquery-1.7.2.min"></script>
<script type="text/javascript" src="js/jquery.xdomainajax.js"></script>
<script type="text/javascript" src="js/main-link.js"></script>
<ul id="jquery_snippets">
<li>Gathering News...</li>
</ul>
and this my main-link.js
$(document).ready(function() {
$.get(‘http://example.com’, function(res) {
$(res.responseText).find(‘.art-block2 h3’).each(function() {
var anchor = $(this).children(‘a:last’);
jQuery(”, {
html: jQuery(”, {
href: anchor.attr(‘href’),
text: anchor.text()
})
}).appendTo($(‘#jquery_snippets’));
});$(‘#jquery_snippets li:first’).remove();
});
});
What’s the problem? (I’m using phoneGap 1.9.0)
Did you create a domain-whiltelist?
http://docs.phonegap.com/en/1.9.0/guide_whitelist_index.md.html