You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm sure this is just due to my limited knowledge of JavaScript, but the collections by themselves are not standalone.
Within the head of my html file, I include a js file that has the following line of code (as in the demo):
var SortedMap = require("jsCollections/sorted-map");
When the page loads, I get the following error on the console:
"ReferenceError: Can't find variable: require "
So, I tried different js "loaders" such as require.js and modules.js (this one from chiron). I also tried loading each "require" js file from collections in the html head in a particular order. For all of these efforts, I continue to get an error.
For modules.js, I add the following to the html head:
script src="modules.js?./myjsfile.js"
This results in the following errors:
TypeError: '[object Object]' is not a constructor (evaluating 'new SortedMap()') modules.js:445
(anonymous function) modules.js:445
(anonymous function) modules.js:349
(anonymous function) modules.js:91
(anonymous function) modules.js:493
TypeError: '[object Object]' is not a constructor (evaluating 'new SortedMap()')
If it helps, I'm using jquery which I load first in the html head and I'm using a webkit browser compiled with QT for Linux (Ubuntu).
I would appreciate any help that would allow me to load and run the js collections. I suppose that I need to add a js loader. I would prefer this loader to be of a minimal file size.
If the issue is not clear please let me know so that I can clarify it. As a recap, I cannot run the js collections just by themselves because of the require, module, and exports functions/variables. I need to understand what else is needed to run the js collections.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
I'm sure this is just due to my limited knowledge of JavaScript, but the collections by themselves are not standalone.
Within the head of my html file, I include a js file that has the following line of code (as in the demo):
var SortedMap = require("jsCollections/sorted-map");
When the page loads, I get the following error on the console:
"ReferenceError: Can't find variable: require "
So, I tried different js "loaders" such as require.js and modules.js (this one from chiron). I also tried loading each "require" js file from collections in the html head in a particular order. For all of these efforts, I continue to get an error.
For modules.js, I add the following to the html head:
script src="modules.js?./myjsfile.js"
This results in the following errors:
TypeError: '[object Object]' is not a constructor (evaluating 'new SortedMap()') modules.js:445
(anonymous function) modules.js:445
(anonymous function) modules.js:349
(anonymous function) modules.js:91
(anonymous function) modules.js:493
TypeError: '[object Object]' is not a constructor (evaluating 'new SortedMap()')
If I add each require in the html head like this:
script src="jquery.js"
script src="jsCollections/sorted-map.js"
script src="jsCollections/sorted-set.js"
script src="jsCollections/reducible.js"
script src="jsCollections/operators.js"
script src="jsCollections/tree-log.js"
script src="jsCollections/abstract-map.js"
script src="myjsfile.js"
I get the following errors on the console:
ReferenceError: Can't find variable: require sorted-map.js:2
ReferenceError: Can't find variable: module sorted-set.js:2
ReferenceError: Can't find variable: module reducible.js:2
ReferenceError: Can't find variable: exports operators.js:9
ReferenceError: Can't find variable: module tree-log.js:2
ReferenceError: Can't find variable: module abstract-map.js:2
ReferenceError: Can't find variable: require myjsfile.js:1
If it helps, I'm using jquery which I load first in the html head and I'm using a webkit browser compiled with QT for Linux (Ubuntu).
I would appreciate any help that would allow me to load and run the js collections. I suppose that I need to add a js loader. I would prefer this loader to be of a minimal file size.
If the issue is not clear please let me know so that I can clarify it. As a recap, I cannot run the js collections just by themselves because of the require, module, and exports functions/variables. I need to understand what else is needed to run the js collections.
Thanks in advance.
The text was updated successfully, but these errors were encountered: