0

Is there any way to change the underlying function of innerHTML() so a custom function will be responsible to add things to the DOM? Is there a way to change the prototype function of innerHTML()?

The reason I ask is because the Samsung TV's do not like when innerHTML() is used. Instead, Samsung suggests using their own API to write to the DOM. However, it would be nice if my app's codebase can be used across other non-Samsung platforms. So it would be ideal if I could change how innerHTML() works in one JS file so it uses the Samsung function, rather than creating conditional statements throughout the code. Plus, since I am using jquery, it would be nice if I can affect innerHTML() directly since jquery also uses innerHTML().

Wouter J
  • 41,455
  • 15
  • 107
  • 112
jaxim
  • 515
  • 1
  • 9
  • 20

1 Answers1

0

Consider using this. It adds elements to the DOM in a more standard way, but allows you to still write HTML code to add to the DOM.

http://www.optimalworks.net/resources/betterinnerhtml/

rpamely
  • 148
  • 2
  • 8