I’m struggling to create a custom build for a Range Slider. My slider works fine when I use the downloaded dojo.xd.js file from google. When I use the custom builder and replace the dojo.xd.js file with the builder output I get no range slider. Do I need to include dojo.js in addition to the custom built file, which I am doing?
Here is my profile for the custom build:
dependencies ={
layers: [
{
name: "myDojo.js",
dependencies: [
"dijit.form.Slider",
"dojox.form.RangeSlider"]
}
],
prefixes: [
[ "dijit", "../dijit" ],
[ "dojox", "../dojox" ]
]
};
When I open my page I get the following errors. I’m running this locally. No server.
XMLHttpRequest cannot load file:///C:/Projects/dcardcjs/trunk/DRandomizerJS/source/selector/acme.js. Cross origin requests are only supported for HTTP.
dojo.js:15 Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101
CardClass.js:1 Uncaught ReferenceError: dojo is not defined
Thanks for the help.
edit: Here’s my page code.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Kingdom Builder</title>
<link rel="stylesheet" type="text/css" href="main.css" />
<link rel="stylesheet" type="text/css" href="../dijit/themes/nihilo/nihilo.css"/>
<script src="dojo.js"></script>
<script>
dojo.require("dojox.form.RangeSlider");
</script>
<style type="text/css">
@import url(../dijit/RangeSlider.css);
</style>
<script src="jquery.js"></script>
<script src="expansions.js"></script>
<script src="CardClass.js"></script>
</head>
<body>
First, to include the acme selector in the build, you must include it in the build script.
Second, to include the base dojo libs, include ‘dojo/dojo’. Thirdly, I noticed in your html file, you have a script tag importing ‘dojo.js’, make sure to change that to what you have named your layer: ‘myDojo.js’ 🙂 Hope this helps someone out there even if you have moved on to jquery.