8000 Fix profiler throwing javascript errors on IE8 & IE9 #13447 by wvdweij · Pull Request #13634 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fix profiler throwing javascript errors on IE8 & IE9 #13447 #13634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix profiler throw javascript errors on IE8 & IE9 #13447
| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |
  • Loading branch information
Wijnand van der Weij committed Feb 10, 2015
commit 39111356259638aea0f84d3c346fbe52b39b611b
Original file line number Diff line number Diff line change
Expand Up @@ -189,31 +189,23 @@

requestStack.push(stackElement);

var readyStateChangeFunction = function () {
if (self.readyState == 4) {
stackElement.duration = new Date() - stackElement.start;
stackElement.loading = false;
stackElement.error = self.status < 200 || self.status >= 400;
stackElement.profile = self.getResponseHeader("X-Debug-Token");
stackElement.profilerUrl = self.getResponseHeader("X-Debug-Token-Link");

Sfjs.renderAjaxRequests();
}
};

/* check for older browsers */
if (!window.addEventListener) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should use this.addEventListener here as this is what you use just after

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for feedback, changed it

this.attachEvent("readystatechange", function () {
if (self.readyState == 4) {
stackElement.duration = new Date() - stackElement.start;
stackElement.loading = false;
stackElement.error = self.status < 200 || self.status >= 400;
stackElement.profile = self.getResponseHeader("X-Debug-Token");
stackElement.profilerUrl = self.getResponseHeader("X-Debug-Token-Link");

Sfjs.renderAjaxRequests();
}
}, false);
this.attachEvent("onreadystatechange", readyStateChangeFunction, false);
} else {
this.addEventListener("readystatechange", function () {
if (self.readyState == 4) {
stackElement.duration = new Date() - stackElement.start;
stackElement.loading = false;
stackElement.error = self.status < 200 || self.status >= 400;
stackElement.profile = self.getResponseHeader("X-Debug-Token");
stackElement.profilerUrl = self.getResponseHeader("X-Debug-Token-Link");

Sfjs.renderAjaxRequests();
}
}, false);
this.addEventListener("readystatechange", readyStateChangeFunction, false);
}

Sfjs.renderAjaxRequests();
Expand Down
0