Opened 8 years ago

Closed 8 years ago

#14561 closed defect (worksforme)

xhr "load" param broken in Chrome in 1.6 and 1.7

Reported by: lucas Owned by:
Priority: high Milestone: tbd
Component: General Version: 1.7.1
Keywords: Cc:
Blocked By: Blocking:

Description

xhr's seem to be fine, but after receiving response from server it seems that the function specified in "load" is not working.

i just noticed this today -- did Chrome change something that caused this problem?

Change History (4)

comment:1 Changed 8 years ago by lucas

I set up a minimal test case, but since it's an ajax issue I'm providing a script on my server. You can visit it here: http://lucas.pandawhale.org/dojo-xhr-load-test.php

I'll leave this script up until the issue is resolved.

Expected output: the string "106 miles" written to the innerHTML of a div on the page. Actual output: correct in FF, sometimes blank in Chrome.

If it works for you in Chrome, do a hard shift-reload a few times and it always breaks after a few tries (for me).

Client-side code: <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js" type="text/javascript"></script> <script type="text/javascript"> require(["dojo/_base/xhr", "dojo/dom"], function(xhr,dom){

xhr.get({

url: "http://lucas.pandawhale.org/xhr/new-conversation.php?mode=badges&uid=1", handleAs: "json", load: function(data) {

var myDiv = dom.byId("foo"); myDiv.innerHTML = data.badges[0].name;

window.location.href = "http://twitter.com";

}, error: function(error) { }

});

}); </script> </head> <body> <div id="foo"></div> </body> </html>

Last edited 8 years ago by lucas (previous) (diff)

comment:2 Changed 8 years ago by lucas

Actually, I'm now not seeing it anymore with the test case I provided. It seems to happen more reliably with a more complex case, so I'll work on that and resubmit.

Sorry for the inconvenience.

comment:3 Changed 8 years ago by lucas

I think that the problem I was having was due to a combo of some caching issues, a transient problem with Chrome between auto-updates, and some Chrome-specific syntax errors I had in my code. I think that my issue is resolved and it's not actually a problem with the toolkit. Sorry, everyone!

comment:4 Changed 8 years ago by bill

Resolution: worksforme
Status: newclosed

OK, glad it's working now.

Note: See TracTickets for help on using tickets.