Opened 12 years ago

Closed 12 years ago

#3431 closed defect (duplicate)

dojo.xhrGet does not work in IE 7 with handleAs: 'javascript'

Reported by: guest Owned by: James Burke
Priority: high Milestone: 0.9
Component: Core Version: 0.9
Keywords: 9M2, xhrGet, IE 7, JavaScript Cc:
Blocked By: Blocking:

Description

In IE 7 on Windows XP dojo.xhrGet does not return actionable JavaScript?. It does in Firefox.

For instance:

 var handle = dojo.xhrGet({
                url: 'static/js/ct/index.js',
                handleAs: 'javascript',
                sync:true
            });
            main(); 

in the index html page, and in the index.js I have:

function main() {
    alert('moo');
}

and while this works in Firefox (an alert with 'moo' is shown), it doesn't in IE 7.

Attachments (2)

index.html (597 bytes) - added by guest 12 years ago.
index.js (39 bytes) - added by guest 12 years ago.

Download all attachments as: .zip

Change History (6)

Changed 12 years ago by guest

Attachment: index.html added

Changed 12 years ago by guest

Attachment: index.js added

comment:1 Changed 12 years ago by guest

I noticed that if used 'text' instead of 'javascript' and then eval the text that I can make it work in IE 7, but then I lose the sync.

comment:2 Changed 12 years ago by James Burke

Owner: changed from anonymous to James Burke
Status: newassigned

I wonder if this is related to #744, where eval in IE is not done in the window context. If you do window.main = function(){ alert("here"); };, that might work.

comment:3 Changed 12 years ago by guest

That worked like magic. Thank you.

comment:4 Changed 12 years ago by James Burke

Resolution: duplicate
Status: assignedclosed

Closing as dupe of #744

Note: See TracTickets for help on using tickets.