jfroelich / rss-reader

A simple Chrome extension for viewing RSS feeds
Other
10 stars 0 forks source link

Switch from using parent.appendChild to HTML5 parent.append where appropriate #808

Closed jfroelich closed 5 years ago

jfroelich commented 5 years ago

Do it the new HTML5 way.

jfroelich commented 5 years ago

https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/append

The ParentNode.append() method inserts a set of Node objects or DOMString objects after the last child of the ParentNode. DOMString objects are inserted as equivalent Text nodes.

Differences from Node.appendChild():

  • ParentNode.append() allows you to also append DOMString object, whereas Node.appendChild() only accepts Node objects.
  • ParentNode.append() has no return value, whereas Node.appendChild() returns the appended Node object.
  • ParentNode.append() can append several nodes and strings, whereas Node.appendChild() can only append one node.