Hi all and thanks for the help!
I cannot get Dojo require to look for relative paths to the baseUrl. The request path requires for my tManager/pageList.js object are aways “/tManager/pageList.js” when they should be “js/tManager/pageList.js”. It works just fine when I add “js/” to the require path but i’d really like these all to be relative. Here is my code.
<script type="text/javascript">
var dojoConfig = {
baseUrl: "js/",
isDebug: true,
tlmSiblingOfDojo: false,
async: false,
packages: [
{ name: "dojo", location: "lib/dojo" },
{ name: "dijit", location: "lib/dijit" },
{ name: "dojox", location: "lib/dojox" },
{ name: "tManager", location: "tManager/" }
]
};
</script>
<script type="text/javascript" src="js/lib/dojo/dojo.js"></script>
<script type="text/javascript">
require([
"dojo/dom",
"dojo/ready",
"tManager/pageList.js"
], function (dom, ready, pageList) {
ready(function () {
alert("hello world");
});
});
</script>
Here is my folder structure:
\
\js\
\js\lib\
\js\lib\dojo\
\js\lib\dijit\
\js\lib\dojox\
\js\tManager\
Once again thanks for the help in advance!
Assuming your
tManager/pageList.jsis an AMD module get rid of.jsextension inrequire. Otherwise your are performing generic script injection instead of loading a module.