Skip to content

Library: Document that, when using requirejs, a page should only be instantiated after the whole library is loaded, otherwise it may fail to instantiate some widgets #339

@gabrielschulhof

Description

@gabrielschulhof

We need to provide an example of a scenario where somebody uses the library using requirejs, and maybe skips init altogether. For example,

require([
    "jqm/widgets/popup",
    "jqm/widgets/listview",
    "jqm/widgets/page" ], function() {

    $( function() {
        $( "#start-page" ).page();
    });
};

Will not work if requirejs loads page after it has loaded popup and listview. We need to document that, in 1.4.x, one needs to require page before requiring any of the widgets:

require([
    "jqm/widgets/page" ], function() {

    require([
        "jqm/widgets/popup",
        "jqm/widgets/listview" ] ,function() {

        $( function() {
            $( "#start-page" ).page();
        });
    });
});

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions