473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Dojo 1.4 - 1.5 Migration problem dojo.dnd.Source

29
Hi!

I was successfully using dojo.dnd.Source with Dojo 1.4.3 loaded from my webserver. However, as it is shared hosting or for some other reason the loading was horrifyingly slow. (even something like 1min30 secs occasionally)

So I am now trying to switch to DOJO 1.5 and googleapis as source. Result is much better loading times but my problem now is that dojo.dnd is not recognized. here is the code I use for loading dojo.dnd.Source

Expand|Select|Wrap|Line Numbers
  1. <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" type="text/javascript" djConfig="parseOnLoad: true, isDebug: true"></script>
  2. <script language="JavaScript">
  3.  
  4.              dojo.addOnLoad(function() {                
  5.                 dojo.require("dijit.Dialog");
  6.                 dojo.require("dojo.parser");
  7.                 dojo.require("dijit.Editor");
  8.                 dojo.require("dojo.dnd.Source");
  9.  
  10.                 widgetSrcNode = new dojo.dnd.Source("admin_widgetSrcNode", {accept:["unknown"]});
  11.  
The error message I'm getting is as follows:
dojo.dnd is undefined
http://mydomain.com/admin/somepage.php?wp=17
Line 171

-- end of message

Line 171: widgetSrcNode = new dojo.dnd.Source("admin_widgetSrcNode", {accept:["unknown"]});

I can't see any changes in the documentation for dojo.dnd in 1.5 vs 1.4 and I have tried several djconfig options but no luck. What else can I try?
Dec 11 '10 #1

✓ answered by rythmic

I will answer this question myself.

Here is the problem. I did not only switch versions. I also changed the source of DOJO to a CDN.

Calling dojo.js from my own server makes the whole library of dojo available at the next line. This is not the case with calling dojo.js from a CDN. The CDN delivers the different components of dojo asynchronously meaning we don't know that the required functionality will be readily available at the next line.

So what is the solution?
Expand|Select|Wrap|Line Numbers
  1. <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" type="text/javascript"></script>
  2. <script language="JavaScript">
  3.              // put the requires outside of dojo.addonload
  4.              dojo.require("dojo.dnd.Source");
  5.              dojo.require("dijit.Dialog");
  6.              dojo.require("dojo.parser");
  7.              dojo.require("dijit.Editor");
  8.  
  9.              dojo.addOnLoad(function() {                
  10.               // do whatever needs to be done here now that the required files are loaded for sure  
  11.                 widgetSrcNode = new dojo.dnd.Source("admin_widgetSrcNode", {accept:["unknown"]});
  12.  
An easy change of the order of the code was enough to fix the problem.

1 2920
rythmic
29
I will answer this question myself.

Here is the problem. I did not only switch versions. I also changed the source of DOJO to a CDN.

Calling dojo.js from my own server makes the whole library of dojo available at the next line. This is not the case with calling dojo.js from a CDN. The CDN delivers the different components of dojo asynchronously meaning we don't know that the required functionality will be readily available at the next line.

So what is the solution?
Expand|Select|Wrap|Line Numbers
  1. <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" type="text/javascript"></script>
  2. <script language="JavaScript">
  3.              // put the requires outside of dojo.addonload
  4.              dojo.require("dojo.dnd.Source");
  5.              dojo.require("dijit.Dialog");
  6.              dojo.require("dojo.parser");
  7.              dojo.require("dijit.Editor");
  8.  
  9.              dojo.addOnLoad(function() {                
  10.               // do whatever needs to be done here now that the required files are loaded for sure  
  11.                 widgetSrcNode = new dojo.dnd.Source("admin_widgetSrcNode", {accept:["unknown"]});
  12.  
An easy change of the order of the code was enough to fix the problem.
Dec 12 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: plsHelpMe | last post by:
Hi All, I am having a problem. I am using DOJO toolkits to fetch some data on my webpage. Now suppose if i leave my webpage for some time and the session gets expired and then i try to click on...
7
by: raknin | last post by:
Hi, Hi, Now that I am handle the way of use the dojo combobox I moving to the next stage. What I want to do is updating a second combobox automatically when a value is selected in the first...
5
by: gaya3 | last post by:
Hi, can anyone find error in the following example <%@ include file="JspBean.jsp" %> <%@ page import="java.util.*"%> <html> <head> <%
1
by: Snolly | last post by:
Hi all, I am using the open source dojo toolkit v .4.3 (I know it's old but can't upgrade). I have a page with an iframe in it. When the page loads, the iframe is pointing at a local resource...
1
by: kokababu | last post by:
I am trying to load dojo module from different domain; such as dojo.parser, dijit.form.TextBox etc. <html> <head> <script type="text/javascript"> djConfig = { isDebug: true,...
1
by: ashutoshjoshi10 | last post by:
Hi, I am using a Dijit.form.filteringSelect to display values using the dojox.data.QueryReadStore. But, after overriding _filterResponse() to format the data in a Dojo-parsable format, whatever...
1
by: rythmic | last post by:
Hi! Background info What I have is the classic zip code - city relation. They are fed into two QueryReadStores. Each Store back an individual filteringselect box. The datastores are fed...
5
by: kumaran1982 | last post by:
Hi all, I have deployed dojo toolkit source in secure server like https://xyz.com, I have executed my jsp page in firefox , Its throws the error the error is : failed loading...
1
by: kumaran1982 | last post by:
Hi All, I have tried many ways but I can't add the item to dojo combo box dynamically. There are two combobox in my jsp, One is continent values another is country values, On changing the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.