02-25-2011 04:11 PM
From my understanding, jQuery is completely functional within the Playbook Simulator. However, I can't for the life of me get it to work.
I've included the jQuery JS file in my .bar package.
The alert is never called. What am I doing wrong?
Also, is there any kind of console or logging available? I can only assume that this is throwing errors, but I have no idea where to find them.
Solved! Go to Solution.
02-25-2011 04:20 PM
It must be something else causing your app not to work right. My entire app is built on JQuery as a foundation library and I have not had any issues besides the XHR local file stuff not working right (which is a platform issue, not a JQuery issue).
Is JQuery actually getting loaded (file at the right location and all).
Does a simple <script>alert('Hello World!');</script> work?
02-25-2011 04:34 PM
Moving the alert outside of the document.ready works, but everything inside of the document.ready won't run.
How can I find out if jQuery is loading properly? I'm assuming it's not since none of it's features are working. Is there a console or log I can peak at?
02-25-2011 04:47 PM
I don't think there's anything like that. Debugging on the simulator is a royal pain if you ask me. I have developed my entire app in Chrome and I simply try it out in the Simulator every time I finish a major new chunk of functionality. I haven't run into any real differences between Chrome vs. the Simulator so this has been working great for me.
For what it's worth, I'm loading all my JS at the bottom of the page like this:
JQuery comes first, everything else that uses it afterwards and I have no issues or whatsoever. Does your exact example work in Chrome? Sorry if it sounds stupid but I still think there must be something wrong with the package you're sending to the Simulator somehow.
02-25-2011 04:57 PM
I've done all my devloping in Chrome as well, and it's working perfectly. For the time being I'm coding my JS all within the index.html page, but I don't see that being the cause of any problems.
Feel free to ask me all the "stupid" questions you can think of. I encourage it. I'm definitely making a very basic newbie mistake somewhere. I'll double check my package when I get home to make sure everything's being included properly.
Are you using $(document).ready() as well? I know there's 3 or 4 methods of waiting for jQuery and the DOM to be ready, I just want to take that possibilty out of the equation.
02-25-2011 05:08 PM
I was not using $(document).ready() (no need for me because with everything at the bottom I know everything is always ready by the time the code fires up) but for the sake of testing I put it around my pagecontroller code. It worked fine for me.
Try putting script(s) at the bottom of the page and see if the rest of your code works fine
Also feel free to send me a zip with a showcase of this breakage and I'll be happy to take a look to see if I can figure out what is wrong
02-25-2011 11:53 PM - last edited on 11-12-2012 10:15 AM by MSohm
I tried moving the scripts around and still no go. I'm pretty sure jQuery isn't being loaded.
I've tried stripping the app down to absolutely nothing except the document.ready and the alert to test it out and I'm still not having any luck. So I think it's safe to say I'm making a really stupid mistake somewhere in the compile/deploy process.
I've uploaded my project files and the zip here:
I'm compiling with:
"C:\Program Files (x86)\Research In Motion\BlackBerry WebWorks Packager for PlayBook\bbwp\bbwp.exe" app.zip /d /v
I'm deploying with:
"C:\Program Files (x86)\Research In Motion\BlackBerry WebWorks Packager for PlayBook\bbwp\blackberry-tablet-sdk\bin\blackberry
-deploy" -password <password> -installApp -device 192.168.1.111 -package "bin\app.bar"
02-26-2011 02:03 AM
Found the problem. It's a shocker too. I thought maybe there's something wrong with your JQuery JS file so I put mine in, not realizing at that time that I'm on 1.5 and you're on 1.5.1. JQuery 1.5.1 is totally broken on the PlayBook simulator. (!) My app doesn't run on it either. Nothing happens.
Use 1.5 and everything is just fine.
I'll post a separate topic on this issue to let other developers know.