3
votes

I am developing phonegap app using jquerymobile.

but in blackberry 9780 it does not show me alert, my code is

document.addEventListener('deviceready', run, false);

function run(){
            $.getJSON('http://twitter.com/users/usejquery.json?callback=?', function(json){  

                alert(json.followers_count); // not displaying in blackberry
            });
        }

My head part is :

        <script src="phonegap.js">
        </script>
        <script src="jquery1.6.2.js">
        </script>
        <script src="jquery.mobile1.0b3.js">

It works fine in other mobiles like Android,iphone,ipad and also working on my Mozzila browser 8.0 but not working on blackberry OS 6.

Please help me.

Thanks

2
try adding jquery1.6.2.js before any other script - Rafay
@3nigma..ok lets see what will happen....i am uploading my app on phonegap build.. - Tushar Ahirrao
@3nigma ..:( still not working - Tushar Ahirrao
your BB device might not be supported: jquerymobile.com/gbs - Phill Pafford
@PhillPafford...i am testing it on BlackBerry Smartphone Simulators 6.0.0... - Tushar Ahirrao

2 Answers

1
votes

1st make sure that run() is getting executed, if not, then try attachEvent element.attachEvent('ondeviceready',run)

Edit

refer

JQuery JSONP cross domain call not doing anything and jQuery, JSON and Apache problem

1
votes

A few things:

  1. there is a new version of jqm, the v1.0 RC1, try to work with this one.
  2. Use the Ripple Emulator from RIM to test more quiccly the app, is a Chrome broser plugin.

And the most important:

deviceready needs:

  1. in your body make this: <body onLoad='initSO()'>

then in the header, after loading: json2.js, phongap, jquery, jquerymobile... put this

function initSO() {
            console.log('initSO()');
           document.addEventListener("deviceready", onDeviceReadySO, true); 
}

function onDeviceReadySO() {
console.log('hello word :D ');
}