خرید بک لینک

Vote count: 0

I load javascript files and libs with requirejs but, and I can see in the network tab in the debugger web console that tether is loaded before bootstrap, even though, in the console I still get

Error: Bootstrap tooltips require Tether

Here is my code:

var paths = {
    backbone: 'libs/backbone',
    jquery: 'libs/jquery-3.1.1.min',
    underscore: 'libs/underscore',
    tether: 'libs/tether.min',
    bootstrap: 'libs/bootstrap.min',
    markerclusterer: 'libs/markerclusterer'
}

var shim = {
    backbone: {
        deps: ['underscore', 'jquery'],
        exports: 'Backbone'
    },
    underscore: {
        exports: '_'
    },
    jquery: {
        exports: '$'
    },
    bootstrap: {
        deps: ['jquery', 'tether']
    }
}

// set up require.js
require.config({
    baseUrl: '/static/js/',
    paths: paths,
    shim: shim
});

require(['Router', 'backbone', 'jquery', 'models/profile', 'markerclusterer', 'tether', 'bootstrap'], function(Router, Backbone, $, Profile) {
    .
    ..
    ...
});

I found an answer here but I would like to avoid storing variables or objects into window since it is a bad practice. Thank you.

asked 25 secs ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 4 ارديبهشت 1396 ساعت: 19:36

صفحه بندی