Jupiter Jones wrote:
> Thanks Nico,
>
> I had actually tried that, but had mobile loading before amber, which loads jquery, so that was never going to work :)
>
> An easy fix - thank you.
>
> Cheers,
>
> Jupiter
> On 22/10/2013, at 12:25 PM, Nicolas Petton<
petton....@gmail.com> wrote:
>
>> It may not come from there, but the way you load the jquery-mobile.js
>> doesn't seem right. As jQuery is loaded through require.js, you should
>> do the same with jQuery mobile, and make sure that jQuery is loaded
>> *before*.
To make this bulletproof, you should add a few things to requirejs
config, see below.
>> You could add it to the requirements in the `require(...)' statement.
>>
>> Cheers,
>> Nico
>>
>> Jupiter Jones writes:
>>
>>> Hi Nico,
>>>
>>> Thanks for the quick reply :)
>>>
>>> Here's my index page:
>>>
>>> <!DOCTYPE html>
>>> <html>
>>> <head>
>>> <meta charset="utf-8" />
>>> <meta name="format-detection" content="telephone=no" />
>>> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
>>>
>>> <title>TestProject</title>
>>>
>>> <script type="text/javascript" src="assets/amber/support/amber.js"></script>
>>> <script type="text/javascript" src="assets/amber/support/requirejs/require.min.js"></script>
>>> <link rel="stylesheet" type="text/css" href="assets/stylesheets/jquery.mobile-1.3.2.min.css" />
>>>
>>> <script type="text/javascript">
>>> require.config({ paths: {
>>> 'com_test': 'src/js',
>>> 'com_test/_source': 'src/st'
>>> }});
require.config({ paths: {
'com_test': 'src/js',
'com_test/_source': 'src/st',
'jquery-mobile': 'assets/javascripts/jquery.mobile-1.3.2.min'
}, shim: {
'jquery-mobile': { deps: [ 'jquery' ] }
});
>>> require([
>>> 'amber/devel',
>>> 'com_test/Project-Core'
, 'jquery-mobile'
>>> ], function (smalltalk) {
>>> smalltalk.defaultAmdNamespace = "com_test";
>>> smalltalk.initialize();
>>> });
>>> </script>
>>> </head>
>>> <body>
>>> <button onclick="require('amber/helpers').popupHelios()">class browser</button>
>>> <script type="text/javascript" src="cordova.js"></script>
>>> <script type="text/javascript" src="js/index.js"></script>
>>> <script type="text/javascript" src="assets/javascripts/jquery.mobile-1.3.2.min.js"></script>
>>> <script type="text/javascript">
>>> app.initialize();
>>> </script>
>>> </body>
>>> </html>
>>>
>>> Thanks for any advice.
>>>
>>> Kind Regards,
>>>
>>> Jupiter
Not tested, but you get the idea. Look into amber.js to see how it's
done there, you can also load other .js's and .css's similar way.
Herby