Uncaught ReferenceError: define is not defined

Uncaught ReferenceError: define is not defined

cuneytcuneyt Posts: 3Questions: 1Answers: 0

Hello,

I have problem with editor plugin. I want to implement editor plugin as here: https://editor.datatables.net/examples/inline-editing/columns.html

But i am getting javascript errors like this:

popup.js:7 Uncaught TypeError: Cannot read property 'getSelected' of undefined
at popup.js:7
pace.min.js:2 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

jquery-1.12.4.js:9747 Uncaught ReferenceError: define is not defined
at eval (eval at <anonymous> (jquery-1.12.4.js:349), <anonymous>:1:5742)
at eval (eval at <anonymous> (jquery-1.12.4.js:349), <anonymous>:1:7850)
at eval (<anonymous>)
at jquery-1.12.4.js:349
at Function.globalEval (jquery-1.12.4.js:350)
at text script (jquery-1.12.4.js:10372)
at ajaxConvert (jquery-1.12.4.js:9332)
at done (jquery-1.12.4.js:9789)
at callback (jquery-1.12.4.js:10311)
at Object.send (jquery-1.12.4.js:10321)

my view file is like this:

<link href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css">
<link href="https://cdn.datatables.net/buttons/1.5.1/css/buttons.dataTables.min.css" rel="stylesheet" type="text/css">
<link href="https://cdn.datatables.net/select/1.2.5/css/select.dataTables.min.css" rel="stylesheet" type="text/css">
<link href="assets/css/datatables.editor/editor.dataTables.min.css" rel="stylesheet" type="text/css">

table id="example" class="display" cellspacing="0" width="100%">
thead>
tr>
th></th>
th>ID</th>
th>XXX</th>

        /tr>
    /thead>

/table>

script src="https://code.jquery.com/jquery-1.12.4.js" type="text/javascript"></script>
script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js" type="text/javascript"></script>
script src="https://cdn.datatables.net/buttons/1.5.1/js/dataTables.buttons.min.js" type="text/javascript"></script>
script src="https://cdn.datatables.net/select/1.2.5/js/dataTables.select.min.js" type="text/javascript"></script>

script src="assets/js/plugins/datatables.editor/dataTables.editor.min.js" type="text/javascript"></script>
script src="assets/js/plugins/datatables.editor/custom.js" type="text/javascript"></script>

when i put first line alert("hello") into my custom.js file it doesn't work but when i put it to first line of dataTables.editor.min.js file, it works so i suppose the problem is inside the dataTables.editor.min.js file which i downloaded it from editors official site.

I looked for if i include multiple times of javascripts but everything seems correct.

I read a lot in the forums but did not find any solution.
Is there a way to solve this problem?

Answers

  • cuneytcuneyt Posts: 3Questions: 1Answers: 0

    One more thing: I am unable to send you a link because working on localhost.

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    I don't immediately see anything wrong with your code there. Are you able to give me a link to the page showing the issue so I can take a look please?

    Thanks,
    Allan

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    popup.js:7 Uncaught TypeError: Cannot read property 'getSelected' of undefined
    at popup.js:7
    pace.min.js:2 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

    popup.js and pace.min.js are not DataTables files.

  • cuneytcuneyt Posts: 3Questions: 1Answers: 0

    I solved my problem. I dont know how but i think my dataTables.editor.min.js file is corrupted. I change the file with the original one and the error gone.

    Sorry for your time consuming.

    Best regards.

This discussion has been closed.