logo       

DWR, Dojo, and AJAX issue: msg#00177

java.dwr.user

Subject: DWR, Dojo, and AJAX issue

Hello all,

I'm working on a relatively simple dojo module that allows for lazily-loading DWR services. Reason: if I have a widget that requires a DWR service, I don't want to have to make sure the enclosing HTML page has the appropriate script tags -- I want to say inside my dojo module: mycompany.dwr.loadDWRService("WidgetDWRService");

My solution so far works great in FF2.0, but I'm having trouble getting it to work in IE7 -- I think the DWR JavaScript files aren't evaluating correctly in IE7.

Here is my module; hoping someone familiar with dojo (I'm using 0.4.1) and DWR (I'm using 1.1.3) can help me figure out the issue and/or a workaround:
================================
dojo.provide("dynedge.dwr.common");

mycompany.dwr.loadDWREngine = function() {
if (! dj_undef("DWREngine")) {
dojo.debug("Engine already loaded");
return;
}

dojo.debug("Result of load: " + dojo.hostenv.loadPath("../../dwr/engine.js"));
if (dj_undef("DWREngine")) {
dojo.debug("DWREngine doesn't exist -- loading failed");
} else {
dojo.debug("DWREngine successfully loaded");
}
};

mycompany.dwr.loadDWRService = function(/*String*/dwrName) {
// First trying to load the DWREngine
mycompany.dwr.loadDWREngine();

if (! dj_undef(dwrName)) {
dojo.debug(dwrName + " already loaded");
return;
}

dojo.debug("Result of service load: "
+ dojo.hostenv.loadPath("../../dwr/interface/" + dwrName + ".js"));
if (dj_undef(dwrName)) {
dojo.debug(dwrName + " doesn't exist -- loading failed");
} else {
dojo.debug(dwrName + " successfully loaded");
}
};
================================

In my dojo widget, I'm making the following call: mycompany.dwr.loadDWRService("WidgetDWRService");

In Firefox 2.0.0.1, this is the dojo.debug output from above:
Result of load: true
DWREngine successfully loaded
Result of service load: true
WidgetDWRService successfully loaded
Engine already loaded

In Internet Explorer 7.0.5730.11, this is the dojo.debug output from above:
Result of load: true
DWREngine doesn't exist -- loading failed
Result of service load: true
WidgetDWRService doesn't exist -- loading failed


Anyone have any ideas why this would work perfectly in Firefox but not in IE7, and how I could go about debugging it? I know IE7 is a little awkward with AJAX support with its ActiveX and native XMLHttpRequest objects each being a little different, but I don't know enough about that to know if it's what the issue is here.

Thanks much,
Jim


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise