Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Fix html() set in IE #3069

Closed
wants to merge 1 commit into from
Closed

Fix html() set in IE #3069

wants to merge 1 commit into from

Conversation

emhagman
Copy link
Contributor

There is an issue here: #3050.
This commit should fix the IE8 issue.

IE doesn't like using innerHTML as seen here:
http://msdn.microsoft.com/en-us/library/ms532998%28v=vs.85%29.aspx#TOM_Create

@tonatiuh
Copy link

tonatiuh commented Jul 1, 2013

Nice, I hope it works, and if it does then that it be merged soon to master.

@pkozlowski-opensource
Copy link
Member

PR Checklist (Minor Bugfix)

  • Contributor signed CLA now or in the past (if you just signed, leave a comment here with your real name)
  • PR doesn't introduce new api
  • PR doesn't contain a breaking change
  • PR contains unit tests
  • PR contains e2e tests (if suitable)
  • PR contains documentation update (if suitable)
  • PR passes all tests on Travis (sanity)
  • PR passes all tests on ci.angularjs.org (cross-browser compatibility)
  • PR is rebased against recent master
  • PR is squashed into one commit per logical change
  • PR's commit messages are descriptive and allows us to autogenerate release notes (required commit message format)
  • All changes requested in review have been implemented

@pkozlowski-opensource
Copy link
Member

@emhagman Thank you for this PR.

We will need a unit-test that demonstrates the issue before this change can be merged. I've also included a checklist for you so you can see which items are mandatory to follow according to the http://docs.angularjs.org/misc/contribute

@petebacondarwin
Copy link
Contributor

@emhagman - can you make sure you sign the CLA please? Thanks

try {
element.innerHTML = value;
} catch (e) {
element.appendChild(value);
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to empty the element first

@ksheedlo
Copy link
Contributor

ksheedlo commented Aug 7, 2013

Hi there! Thanks for the PR.

Unfortunately, we're not going to be able to merge it. element.appendChild needs to work on DOM nodes, not strings. Further, custom elements are so broken in IE8 that you should really avoid them if you want to support IE8 properly. We don't want to encourage broken behavior and there's not a reliable way we've found to get this to work.

@ksheedlo ksheedlo closed this Aug 7, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants