Search code examples
blackberry-webworks

BlackBerry WebWorks Project using CSS and JS from CDN


I am developing application for blackberry using webworks. can the project use javascript (jquery and jquery mobile) or css from CDN network (internet) like this:

    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
    <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>

I have tried it in Ripple emulator, and it works fine. When I tried it on BlackBerry simulator and directly on the device, the application appeared without styling. thank you.


Solution

  • The reason why it works in the Ripple emulator but not in the simulator or on the device is: The Ripple emulator is essentially a web browser and does not accurately depict device-specific behaviour.

    Blackberry simulators and devices require the white-listing of any external webservices that are being used by the application.

    In order to do that, you'll need to follow the instructions in the following links for editing your config.xml https://developer.blackberry.com/html5/documentation/access_element_834677_11.html https://developer.blackberry.com/html5/documentation/securing_your_ww_app_1866986_11.html