Link to home
Start Free TrialLog in
Avatar of chuang4630

asked on

Question on RequireJS and Jquery datatables

I received the following error:

Uncaught TypeError: Cannot read property 'oApi' of undefined

jquery datatables: DataTables-1.10.3
RequiresJS: RequireJS 2.1.18

    shim: {
        jquery: {
            export: '$'
        jqueryui: { deps: ["jquery"] },
        'jquery.validate': { deps: ["jquery"] },
        'datatables': { deps: ["jquery"] },
        angular: {
            exports: 'angular',
            deps: ["jquery"]
        angularApp: {
            exports: 'angularApp',
            deps: ['angular']

        global: { deps: ["jquery"] }
    paths: {
        jquery: ['//',
          // fallback to local jQuery
        'datatables': 'DataTables-1.10.3/jquery.dataTables',
        bootstrap: 'bootstrap',
        less: 'less.min',
        'jquery.validate': 'jquery.validate',
        domReady: 'libs/domReady',
        'angularApp': '/bundles/app?',

// Require Global dependencies
require(['jquery', 'jquery.validate', 'jqueryui', 'global',
], function ($, jqvalidate, jqueryui, global) {

    // Since we're loading angular asynchronously, we must handle the bootstrapping process

    // Load scripts for IE
    if ($('html').hasClass('lt-ie9') || $('html').hasClass('ie9')) {
        require(['/Scripts/jquery.placeholder.js'], function (ieScript) {
            // fix placeholders for IE9 and below
            $('input, textarea').placeholder();




        <script data-main="@Url.Content("~/Scripts/main")" src="@Url.Content("~/Scripts/libs/require.js")"></script>

I have spent over a day on this issue but couldn't configured it out.
Need help on the problem.

Thanks in advance
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial