Dojo 1.1 and 1.3 on the same page
June 16th, 2009 by Brian | Filed under work.Today I dug into the deep dark world of running multiple versions of Dojo on the same page. Turns out, it’s not all that dark! Working with some pages as my guide I was able to get 1.1 & 1.3 working in the same page.
This is a step towards running multiple versions withing WebSphere Portal, which I’ll likely be dealing with in the near future.
<head>
<title>Dojo 1.1 and Dojo 1.3 together on the same page </title>
<!– Bring in Dojo 1.1.x –>
<script type="text/javascript">
djConfig = {
parseOnLoad: true,
baseUrl: "dojo11/dojo/"
}
</script>
<script type="text/javascript" src="dojo11/dojo/dojo.js"></script>
<!–
redefine djConfig (allowed in 1.1+)
create namespaced dojo, dijit & dojox
–>
<script type="text/javascript">
djConfig = {
isDebug: true,
baseRelativePath: "dojo13/dojo",
scopeMap: [
["dojo", "dojo13"],
["dijit", "dijit13"],
["dojox", "dojox13"]
]
}
</script>
<script type="text/javascript" src="dojo13/dojo/dojo.js"></script>
<!– test it –>
<script type="text/javascript">
dojo.addOnLoad(function(){
alert(dojo.version);
});
dojo13.addOnLoad(function(){
alert(dojo13.version);
});
</script>
</head>
<body>
Dojo 1.1 and Dojo 1.3 together on the same page
</body>
</html>
Tags: dojo


Hey Brian! This is exactly the information I needed. Glad to see you’re still going strong. Cheers!
Have you run into any issues with Dijit CSS conflicts when running multiple Dojo versions?
Hey Michael, good to hear from you. I haven’t used Dojo since I was at IBM, but I don’t remember any dijit css issues from when I worked out the above example.