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

Conversation

wvdweij
Copy link
@wvdweij wvdweij commented Feb 10, 2015

No description provided.

}, false);
/* check for older browsers */
if (!window.addEventListener) {
this.attachEvent("readystatechange", function () {
Copy link
Member

Choose a reason for hiding this comment

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

It's onreadystatechange if I'm not wrong?
I'd also deduplicate the closure by putting it in a variable

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, will fix it!

Copy link
Contributor

Choose a reason for hiding this comment

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

It can be nice to add a comment like that to help people to handerstand this part of code.

// Fix ie8&9, does not have XMLHttpRequest.addEventListener method.
// @see https://developer.mozilla.org/fr/docs/Web/API/Element.addEventListener#Internet_Explorer

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |
};

/* 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

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |
@WedgeSama
Copy link
Contributor

There is also 2 addEventListener calls in Collection:form.html.twig at lines 284 & 383.

@fabpot
Copy link
Member
fabpot commented Feb 10, 2015

Closing in favor of #13636

@fabpot fabpot closed this Feb 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0