{"id":64248,"date":"2019-04-27T04:22:15","date_gmt":"2019-04-27T11:22:15","guid":{"rendered":"http:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/"},"modified":"2019-04-27T04:22:15","modified_gmt":"2019-04-27T11:22:15","slug":"getting-to-know-the-mutationobserver-api","status":"publish","type":"post","link":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/","title":{"rendered":"Getting To Know The MutationObserver API"},"content":{"rendered":"<link rel=\"canonical\" href=\"https:\/\/www.smashingmagazine.com\/2019\/04\/mutationobserver-api-guide\/\"><title>Getting To Know The MutationObserver API<\/title><\/p>\n<article>\n<header>\n<h1>Getting To Know The MutationObserver API<\/h1>\n<address>Louis Lazaris<\/address>\n<p>                  <time datetime=\"2019-04-26T13:30:16+02:00\">2019-04-26T13:30:16+02:00<\/time><time datetime=\"2019-04-27T11:04:42+00:00\">2019-04-27T11:04:42+00:00<\/time><\/header>\n<p>In complex web apps, DOM changes can be frequent. As a result, there are instances where your app might need to respond to a specific change to the DOM.<\/p>\n<p>For some time, the accepted way to look for changes to the DOM was by means of a feature called <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/Guide\/Events\/Mutation_events\">Mutation Events<\/a>, which is <a href=\"https:\/\/www.w3.org\/TR\/DOM-Level-3-Events\/#interface-mutationevent\">now deprecated<\/a>. The W3C-approved replacement for Mutation Events is the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/MutationObserver\">MutationObserver API<\/a>, which is what I\u2019ll be discussing in detail in this article.<\/p>\n<p>A number of older articles and references discuss why the old feature was replaced, so I won\u2019t go into detail on that here (besides the fact that I wouldn\u2019t be able to do it justice). The <code>MutationObserver<\/code> API has <a href=\"https:\/\/caniuse.com\/#feat=mutationobserver\">near complete browser support<\/a>, so we can use it safely in most \u2014 if not all \u2014 projects, should the need arise.<\/p>\n<h3>Basic Syntax For A MutationObserver<\/h3>\n<p>A <code>MutationObserver<\/code> can be used in a number of different ways, which I\u2019ll cover in detail in the rest of this article, but the basic syntax for a <code>MutationObserver<\/code> looks like this:<\/p>\n<pre><code>let observer = new MutationObserver(callback);\n    \nfunction callback (mutations) {\n  \/\/ do something here\n}\n\nobserver.observe(targetNode, observerOptions);\n<\/code><\/pre>\n<p>The first line creates a new <code>MutationObserver<\/code> using the <code>MutationObserver()<\/code> constructor. The argument passed into the constructor is a callback function that will be called on each DOM change that qualifies.<\/p>\n<p>The way to determine what qualifies for a particular observer is by means of the final line in the above code. On that line, I\u2019m using the <code>observe()<\/code> method of the <code>MutationObserver<\/code> to begin observing. You can compare this to something like <code>addEventListener()<\/code>. As soon as you attach a listener, the page will \u2018listen\u2019 for the specified event. Similarly, when you start observing, the page will begin \u2018observing\u2019 for the specified <code>MutationObserver<\/code>.<\/p>\n<div data-component=\"FeaturePanel\" data-audience=\"non-subscriber\" data-remove=\"true\"><\/div>\n<p>The <code>observe()<\/code> method takes two arguments: The <em>target<\/em>, which should be the node or node tree on which to observe for changes; and an <em>options<\/em> object, which is a <code>MutationObserverInit<\/code> object that allows you to define the configuration for the observer.<\/p>\n<p>The final key basic feature of a <code>MutationObserver<\/code> is the <code>disconnect()<\/code> method. This allows you to stop observing for the specified changes, and it looks like this:<\/p>\n<pre><code>observer.disconnect();\n<\/code><\/pre>\n<h3>Options To Configure A MutationObserver<\/h3>\n<p>As mentioned, the <code>observe()<\/code> method of a <code>MutationObserver<\/code> requires a second argument that specifies the options to describe the <code>MutationObserver<\/code>. Here\u2019s how the options object would look with all possible property\/value pairs included:<\/p>\n<pre><code>let options = {\n  childList: true,\n  attributes: true,\n  characterData: false,\n  subtree: false,\n  attributeFilter: ['one', 'two'],\n  attributeOldValue: false,\n  characterDataOldValue: false\n};\n<\/code><\/pre>\n<p>When setting up the <code>MutationObserver<\/code> options, it\u2019s not necessary to include all these lines. I\u2019m including these simply for reference purposes, so you can see what options are available and what types of values they can take. As you can see, all except one are Boolean.<\/p>\n<p>In order for a <code>MutationObserver<\/code> to work, at least one of <code>childList<\/code>, <code>attributes<\/code>, or <code>characterData<\/code> needs to be set to <code>true<\/code>, otherwise an error will be thrown. The other four properties work in conjunction with one of those three (more on this later).<\/p>\n<p>So far I\u2019ve merely glossed over the syntax to give you an overview. The best way to consider how each of these features works is by providing code examples and live demos that incorporate the different options. So that\u2019s what I\u2019ll do for the rest of this article.<\/p>\n<div><\/div>\n<h3>Observing Changes To Child Elements Using childList<\/h3>\n<p>The first and simplest <code>MutationObserver<\/code> you can initiate is one that looks for child nodes of a specified node (usually an element) to be added or removed. For my example, I\u2019m going to create an unordered list in my HTML, and I want to know whenever a child node is added or removed from this list element.<\/p>\n<p>The HTML for the list looks like this:<\/p>\n<pre><code><ul id=\"myList\" class=\"list\">\n  <li>Apples<\/li>\n  <li>Oranges<\/li>\n  <li>Bananas<\/li>\n  <li class=\"child\">Peaches<\/li>\n<\/ul>\n<\/code><\/pre>\n<p>The JavaScript for my <code>MutationObserver<\/code> includes the following:<\/p>\n<div>\n<pre><code>let mList = document.getElementById('myList'),\noptions = {\n  childList: true\n},\nobserver = new MutationObserver(mCallback);\n\nfunction mCallback(mutations) {\n  for (let mutation of mutations) {\n    if (mutation.type === 'childList') {\n      console.log('Mutation Detected: A child node has been added or removed.');\n    }\n  }\n}\n\nobserver.observe(mList, options);\n<\/code><\/pre>\n<\/div>\n<p>This is only part of the code. For brevity, I\u2019m showing the most important sections that deal with the <code>MutationObserver<\/code> API itself.<\/p>\n<p>Notice how I\u2019m looping through the <code>mutations<\/code> argument, which is a <code>MutationRecord<\/code> object that has a number of different properties. In this case, I\u2019m reading the <code>type<\/code> property and logging a message indicating that the browser has detected a mutation that qualifies. Also, notice how I\u2019m passing the <code>mList<\/code> element (a reference to my HTML list) as the targeted element (i.e. the element on which I want to observe for changes).<\/p>\n<ul>\n<li><a href=\"https:\/\/codepen.io\/impressivewebs\/pen\/aXVVjg?editors=0011\">See full interactive demo \u00a0?<\/a><\/li>\n<\/ul>\n<p>Use the buttons to start and stop the <code>MutationObserver<\/code>. The log messages help clarify what\u2019s happening. Comments in the code also provide some explanation.<\/p>\n<p>Note a few important points here:<\/p>\n<ul>\n<li>The callback function (which I\u2019ve named <code>mCallback<\/code>, to illustrate that you can name it whatever you want) will fire each time a successful mutation is detected and after the <code>observe()<\/code> method is executed.<\/li>\n<li>In my example, the only \u2018type\u2019 of mutation that qualifies is <code>childList<\/code>, so it makes sense to look for this one when looping through the MutationRecord. Looking for any other type in this instance would do nothing (the other types will be used in subsequent demos).<\/li>\n<li>Using <code>childList<\/code>, I can add or remove a text node from the targeted element and this too would qualify. So it doesn\u2019t have to be an element that\u2019s added or removed.<\/li>\n<li>In this example, only immediate child nodes will qualify. Later in the article, I\u2019ll show you how this can apply to all child nodes, grandchildren, and so on.<\/li>\n<\/ul>\n<h3>Observing For Changes To An Element\u2019s Attributes<\/h3>\n<p>Another common type of mutation that you might want to track is when an attribute on a specified element changes. In the next interactive demo, I\u2019m going to observe for changes to attributes on a paragraph element.<\/p>\n<pre><code>let mPar = document.getElementById('myParagraph'),\n  options = {\n    attributes: true\n  },\n  observer = new MutationObserver(mCallback);\n\nfunction mCallback (mutations) {\n  for (let mutation of mutations) {\n    if (mutation.type === 'attributes') {\n      \/\/ Do something here...\n    }\n  }\n}\n\nobserver.observe(mPar, options);\n<\/code><\/pre>\n<ul>\n<li><a href=\"https:\/\/codepen.io\/impressivewebs\/pen\/XOzaWv?editors=0011\">Try out the demo \u00a0?<\/a><\/li>\n<\/ul>\n<p>Again, I\u2019ve abbreviated the code for clarity, but the important parts are:<\/p>\n<ul>\n<li>The <code>options<\/code> object is using the <code>attributes<\/code> property, set to <code>true<\/code> to tell the <code>MutationObserver<\/code> that I want to look for changes to the targeted element\u2019s attributes.<\/li>\n<li>The mutation type I\u2019m testing for in my loop is <code>attributes<\/code>, the only one that qualifies in this case.<\/li>\n<li>I\u2019m also using the <code>attributeName<\/code> property of the <code>mutation<\/code> object, which allows me to find out which attribute was changed.<\/li>\n<li>When I trigger the observer, I\u2019m passing in the paragraph element by reference, along with the options.<\/li>\n<\/ul>\n<p>In this example, a button is used to toggle a class name on the targeted HTML element. The callback function in the mutation observer is triggered every time the class is added or removed.<\/p>\n<div><\/div>\n<h3>Observing For Character Data Changes<\/h3>\n<p>Another change you might want to look for in your app is mutations to character data; that is, changes to a specific text node. This is done by setting the <code>characterData<\/code> property to <code>true<\/code> in the <code>options<\/code> object. Here\u2019s the code:<\/p>\n<pre><code>let options = {\n    characterData: true\n  },\n  observer = new MutationObserver(mCallback);\n  \nfunction mCallback(mutations) {\n  for (let mutation of mutations) {\n    if (mutation.type === 'characterData') {\n      \/\/ Do something here...\n    }\n  }\n}\n<\/code><\/pre>\n<p>Notice again the <code>type<\/code> being looked for in the callback function is <code>characterData<\/code>.<\/p>\n<ul>\n<li><a href=\"https:\/\/codepen.io\/impressivewebs\/pen\/pGdpvq?editors=0011\">See live demo \u00a0?<\/a><\/li>\n<\/ul>\n<p>In this example, I\u2019m looking for changes to a specific text node, which I target via <code>element.childNodes[0]<\/code>. This is a little hacky but it will do for this example. The text is user-editable via the <code>contenteditable<\/code> attribute on a paragraph element.<\/p>\n<h4>Challenges When Observing For Character Data Changes<\/h4>\n<p>If you\u2019ve fiddled around with <code>contenteditable<\/code>, then you might be aware that there are keyboard shortcuts that allow for rich text editing. For example, CTRL-B makes text bold, CTRL-I makes text italic, and so forth. This will break up the text node into multiple text nodes, so you\u2019ll notice the <code>MutationObserver<\/code> will stop responding unless you edit the text that\u2019s still considered part of the original node.<\/p>\n<p>I should also point out that if you delete all the text, the <code>MutationObserver<\/code> will no longer trigger the callback. I\u2019m assuming this happens because once the text node disappears, the target element is no longer in existence. To combat this, my demo stops observing when the text is removed, although things do get a little sticky when you use rich text shortcuts.<\/p>\n<p>But don\u2019t worry, later in this article, I\u2019ll discuss a better way to use the <code>characterData<\/code> option without having to deal with as many of these quirks.<\/p>\n<h3>Observing For Changes To Specified Attributes<\/h3>\n<p>Earlier I showed you how to observe for changes to attributes on a specified element. In that case, although the demo triggers a class name change, I could have changed any attribute on the specified element. But what if I want to observe changes to one or more specific attributes while ignoring the others?<\/p>\n<p>I can do that using the optional <code>attributeFilter<\/code> property in the <code>option<\/code> object. Here\u2019s an example:<\/p>\n<div>\n<pre><code>let options = {\n      attributes: true,\n      attributeFilter: ['hidden', 'contenteditable', 'data-par']\n    },\n    observer = new MutationObserver(mCallback);\n\nfunction mCallback (mutations) {\n  for (let mutation of mutations) {\n    if (mutation.type === 'attributes') {\n      \/\/ Do something here...\n    }\n  }\n}\n<\/code><\/pre>\n<\/div>\n<p>As shown above, the <code>attributeFilter<\/code> property accepts an array of specific attributes that I want to monitor. In this example, the <code>MutationObserver<\/code> will trigger the callback each time one or more of the <code>hidden<\/code>, <code>contenteditable<\/code>, or <code>data-par<\/code> attributes is modified.<\/p>\n<ul>\n<li><a href=\"https:\/\/codepen.io\/impressivewebs\/pen\/pGGdVr?editors=0011\">See live demo \u00a0?<\/a><\/li>\n<\/ul>\n<p>Again I\u2019m targeting a specific paragraph element. Notice the select drop down that chooses which attribute will be changed. The <code>draggable<\/code> attribute is the only one that won\u2019t qualify since I didn\u2019t specify that one in my options.<\/p>\n<p>Notice in the code that I\u2019m again using the <code>attributeName<\/code> property of the <code>MutationRecord<\/code> object to log which attribute was changed. And of course, as with the other demos, the <code>MutationObserver<\/code> won\u2019t start monitoring for changes until the \u201cstart\u201d button is clicked.<\/p>\n<p>One other thing I should point out here is that I don\u2019t need to set the <code>attributes<\/code> value to <code>true<\/code> in this case; it\u2019s implied due to <code>attributesFilter<\/code> being set to true. That\u2019s why my options object could look as follows, and it would work the same:<\/p>\n<pre><code>let options = {\n  attributeFilter: ['hidden', 'contenteditable', 'data-par']\n}\n<\/code><\/pre>\n<p>On the other hand, if I explicitly set <code>attributes<\/code> to <code>false<\/code> along with an <code>attributeFilter<\/code> array, it wouldn\u2019t work because the <code>false<\/code> value would take precedence and the filter option would be ignored.<\/p>\n<h3>Observing For Changes To Nodes And Their Sub-Tree<\/h3>\n<p>So far when setting up each <code>MutationObserver<\/code>, I\u2019ve only been dealing with the targeted element itself and, in the case of <code>childList<\/code>, the element\u2019s immediate children. But there certainly could be a case where I might want to observe for changes to one of the following:<\/p>\n<ul>\n<li>An element and all its child elements;<\/li>\n<li>One or more attributes on an element and on its child elements;<\/li>\n<li>All text nodes inside an element.<\/li>\n<\/ul>\n<p>All of the above can be achieved using the <code>subtree<\/code> property of the options object.<\/p>\n<h4>childList With subtree<\/h4>\n<p>First, let\u2019s look for changes to an element\u2019s child nodes, even if they\u2019re not immediate children. I can alter my options object to look like this:<\/p>\n<pre><code>options = {\n  childList: true,\n  subtree: true\n}\n<\/code><\/pre>\n<p>Everything else in the code is more or less the same as the previous <code>childList<\/code> example, along with some extra markup and buttons.<\/p>\n<ul>\n<li><a href=\"https:\/\/codepen.io\/impressivewebs\/pen\/PVgyLa?editors=0011\">See live demo \u00a0?<\/a><\/li>\n<\/ul>\n<p>Here there are two lists, one nested inside the other. When the <code>MutationObserver<\/code> is started, the callback will trigger for changes to either list. But if I were to change the <code>subtree<\/code> property back to <code>false<\/code> (the default when it\u2019s not present), the callback would not execute when the nested list is modified.<\/p>\n<h4>Attributes With subtree<\/h4>\n<p>Here\u2019s another example, this time using <code>subtree<\/code> with <code>attributes<\/code> and <code>attributeFilter<\/code>. This allows me to observe for changes to attributes not only on the target element but also on the attributes of any child elements of the target element:<\/p>\n<pre><code>options = {\n  attributes: true,\n  attributeFilter: ['hidden', 'contenteditable', 'data-par'],\n  subtree: true\n}\n<\/code><\/pre>\n<ul>\n<li><a href=\"https:\/\/codepen.io\/impressivewebs\/pen\/ywYaYv?editors=0011\">See live demo \u00a0?<\/a><\/li>\n<\/ul>\n<p>This is similar to the previous attributes demo, but this time I\u2019ve set up two different select elements. The first one modifies attributes on the targeted paragraph element while the other one modifies attributes on a child element inside the paragraph.<\/p>\n<p>Again, if you were to set the <code>subtree<\/code> option back to <code>false<\/code> (or remove it), the second toggle button would not trigger the <code>MutationObserver<\/code> callback. And, of course, I could omit <code>attributeFilter<\/code> altogether, and the <code>MutationObserver<\/code> would look for changes to <em>any<\/em> attributes in the subtree rather than the specified ones.<\/p>\n<h4>characterData With subtree<\/h4>\n<p>Remember in the earlier <code>characterData<\/code> demo, there were some problems with the targeted node disappearing and then the <code>MutationObserver<\/code> no longer working. While there are ways to get around that, it\u2019s easier to target an element directly rather than a text node, then use the <code>subtree<\/code> property to specify that I want all the character data inside that element, no matter how deeply nested it is, to trigger the <code>MutationObserver<\/code> callback.<\/p>\n<p>My options in this case would look like this:<\/p>\n<pre><code>options = {\n  characterData: true,\n  subtree: true\n}\n<\/code><\/pre>\n<ul>\n<li><a href=\"https:\/\/codepen.io\/impressivewebs\/pen\/bZVpMZ?editors=0011\">See live demo \u00a0?<\/a><\/li>\n<\/ul>\n<p>After you start the observer, try using CTRL-B and CTRL-I to format the editable text. You\u2019ll notice this works much more effectively than the previous <code>characterData<\/code> example. In this case, the broken up child nodes don\u2019t affect the observer because we\u2019re observing all nodes inside the targeted node, instead of a single text node.<\/p>\n<h3>Recording Old Values<\/h3>\n<p>Often when observing for changes to the DOM, you\u2019ll want to take note of the old values and possibly store them or use them elsewhere. This can be done using a few different properties in the <code>options<\/code> object.<\/p>\n<h4>attributeOldValue<\/h4>\n<p>First, let\u2019s try logging out the old attribute value after it\u2019s changed. Here\u2019s how my options will look along with my callback:<\/p>\n<pre><code>options = {\n  attributes: true,\n  attributeOldValue: true\n}\n\nfunction mCallback (mutations) {\n  for (let mutation of mutations) {\n    if (mutation.type === 'attributes') {\n      \/\/ Do something here...\n    }\n  }\n}\n<\/code><\/pre>\n<ul>\n<li><a href=\"https:\/\/codepen.io\/impressivewebs\/pen\/wNNjrP?editors=0011\">See live demo \u00a0?<\/a><\/li>\n<\/ul>\n<p>Notice the use of the <code>attributeName<\/code> and <code>oldValue<\/code> properties of the <code>MutationRecord<\/code> object. Try the demo by entering different values in the text field. Notice how the log updates to reflect the previous value that was stored.<\/p>\n<h4>characterDataOldValue<\/h4>\n<p>Similarly, here\u2019s how my options would look if I want to log old character data:<\/p>\n<pre><code>options = {\n  characterData: true,\n  subtree: true,\n  characterDataOldValue: true\n}\n<\/code><\/pre>\n<ul>\n<li><a href=\"https:\/\/codepen.io\/impressivewebs\/pen\/aXrzex?editors=0011\">See live demo \u00a0?<\/a><\/li>\n<\/ul>\n<p>Notice the log messages indicate the previous value. Things do get a little wonky when you add HTML via rich text commands to the mix. I\u2019m not sure what the correct behavior is supposed to be in that case but it is more straightforward if the only thing inside the element is a single text node.<\/p>\n<h3>Intercepting Mutations Using takeRecords()<\/h3>\n<p>Another method of the <code>MutationObserver<\/code> object that I haven\u2019t mentioned yet is <code>takeRecords()<\/code>. This method allows you to more or less intercept the mutations that are detected before they are processed by the callback function.<\/p>\n<p>I can use this feature using a line like this:<\/p>\n<pre><code>let myRecords = observer.takeRecords();\n<\/code><\/pre>\n<p>This stores a list of the DOM changes in the specified variable. <a href=\"https:\/\/codepen.io\/impressivewebs\/pen\/oVNeRp?editors=0011\">In my demo<\/a>, I\u2019m executing this command as soon as the button that modifies the DOM is clicked. Notice that the start and add\/remove buttons don\u2019t log anything. This is because, as mentioned, I\u2019m intercepting the DOM changes before they are processed by the callback.<\/p>\n<p>Notice, however, what I\u2019m doing in the event listener that stops the observer:<\/p>\n<div>\n<pre><code>btnStop.addEventListener('click', function () {\n  observer.disconnect();\n  if (myRecords) {\n    console.log(`${myRecords[0].target} was changed using the ${myRecords[0].type} option.`);\n  }\n}, false);\n<\/code><\/pre>\n<\/div>\n<p>As you can see, after stopping the observer using <code>observer.disconnect()<\/code>, I\u2019m accessing the mutation record that was intercepted and I\u2019m logging the target element as well as the type of mutation that was recorded. If I had been observing for multiple types of changes then the stored record would have more than one item in it, each with its own type.<\/p>\n<p>When a mutation record is intercepted in this way by calling <code>takeRecords()<\/code>, the queue of mutations that would normally be sent to the callback function is emptied. So if for some reason you need to intercept these records before they\u2019re processed, <code>takeRecords()<\/code> would come in handy.<\/p>\n<h3>Observing For Multiple Changes Using A Single Observer<\/h3>\n<p>Note that if I\u2019m looking for mutations on two different nodes on the page, I can do so using the same observer. This means after I call the constructor, I can execute the <code>observe()<\/code> method for as many elements as I want.<\/p>\n<p>Thus, after this line:<\/p>\n<pre><code>observer = new MutationObserver(mCallback);\n<\/code><\/pre>\n<p>I can then have multiple <code>observe()<\/code> calls with different elements as the first argument:<\/p>\n<pre><code>observer.observe(mList, options);\nobserver.observe(mList2, options);\n<\/code><\/pre>\n<ul>\n<li><a href=\"https:\/\/codepen.io\/impressivewebs\/pen\/OqJMeG?editors=0011\">See live demo \u00a0?<\/a><\/li>\n<\/ul>\n<p>Start the observer, then try the add\/remove buttons for both lists. The only catch here is that if you hit one of the \u201cstop\u201d buttons, the observer will stop observing for both lists, not just the one it\u2019s targeting.<\/p>\n<h3>Moving A Node Tree That\u2019s Being Observed<\/h3>\n<p>One last thing I\u2019ll point out is that a <code>MutationObserver<\/code> will continue to observe for changes to a specified node even after that node has been removed from its parent element.<\/p>\n<p>For example, try out the following demo:<\/p>\n<ul>\n<li><a href=\"https:\/\/codepen.io\/impressivewebs\/pen\/GeRWPX?editors=0011\">See live demo \u00a0?<\/a><\/li>\n<\/ul>\n<p>This is another example that uses <code>childList<\/code> to monitor for changes to the child elements of a target element. Notice the button that disconnects the sub-list, which is the one being observed. Click the \u201cStart\u2026\u201d button, then click the \u201cMove\u2026\u201d button to move the nested list. Even after the list is removed from its parent, the <code>MutationObserver<\/code> continues to observe for the specified changes. Not a major surprise that this happens, but it\u2019s something to keep in mind.<\/p>\n<h3>Conclusion<\/h3>\n<p>That covers just about all the primary features of the <code>MutationObserver<\/code> API. I hope this deep dive has been useful for you to get familiar with this standard. As mentioned, <a href=\"https:\/\/caniuse.com\/#feat=mutationobserver\">browser support is strong<\/a> and you can read more about this API <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/MutationObserver\">on MDN\u2019s pages<\/a>.<\/p>\n<p>I\u2019ve put all the demos for this article into <a href=\"https:\/\/codepen.io\/collection\/njwmrK\/\"><br \/>\na CodePen collection<\/a>, should you want to have an easy place to mess around with the demos.<\/p>\n<div>\n  <img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/04\/logo-red-20.png?w=900\" alt=\"Smashing Editorial\"><span>(dm, il)<\/span>\n<\/div>\n<\/article>\n<p class=\"wpematico_credit\"><small>Powered by <a href=\"http:\/\/www.wpematico.com\" target=\"_blank\">WPeMatico<\/a><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting To Know The MutationObserver API Getting To Know The MutationObserver API Louis Lazaris 2019-04-26T13:30:16+02:002019-04-27T11:04:42+00:00 In complex web apps, DOM changes can be frequent. As a result, there are instances where your app might need to respond to a specific change to the DOM. For some time, the accepted way to look for changes to&#8230;<a class=\"moretag\" href=\"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/\"> Read the full article&#8230;<\/a><\/p>\n","protected":false},"author":4,"featured_media":64249,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[371],"tags":[],"class_list":["post-64248","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-user-experience"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Getting To Know The MutationObserver APIGetting To Know The MutationObserver API Louis Lazaris 2019-04-26T13:30:16+02:002019-04-27T11:04:42+00:00In complex web apps, DOM changes can be frequent. As a result, there are instances where your app might need to respond to a specific change to the DOM. For some time, the accepted way to look for changes to the DOM\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Guest Contribution\"\/>\n\t<meta name=\"keywords\" content=\"user experience\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Design for Immersive Technologies | User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Getting To Know The MutationObserver API | Design for Immersive Technologies\" \/>\n\t\t<meta property=\"og:description\" content=\"Getting To Know The MutationObserver APIGetting To Know The MutationObserver API Louis Lazaris 2019-04-26T13:30:16+02:002019-04-27T11:04:42+00:00In complex web apps, DOM changes can be frequent. As a result, there are instances where your app might need to respond to a specific change to the DOM. For some time, the accepted way to look for changes to the DOM\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-04-27T11:22:15+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-04-27T11:22:15+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Getting To Know The MutationObserver API | Design for Immersive Technologies\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Getting To Know The MutationObserver APIGetting To Know The MutationObserver API Louis Lazaris 2019-04-26T13:30:16+02:002019-04-27T11:04:42+00:00In complex web apps, DOM changes can be frequent. As a result, there are instances where your app might need to respond to a specific change to the DOM. For some time, the accepted way to look for changes to the DOM\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/getting-to-know-the-mutationobserver-api\\\/#article\",\"name\":\"Getting To Know The MutationObserver API | Design for Immersive Technologies\",\"headline\":\"Getting To Know The MutationObserver API\",\"author\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.taterboy.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/logo-red-20.png?fit=60%2C80&ssl=1\",\"width\":60,\"height\":80},\"datePublished\":\"2019-04-27T04:22:15-07:00\",\"dateModified\":\"2019-04-27T04:22:15-07:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/getting-to-know-the-mutationobserver-api\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/getting-to-know-the-mutationobserver-api\\\/#webpage\"},\"articleSection\":\"User Experience\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/getting-to-know-the-mutationobserver-api\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.taterboy.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/#listItem\",\"name\":\"User Experience\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/#listItem\",\"position\":2,\"name\":\"User Experience\",\"item\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/getting-to-know-the-mutationobserver-api\\\/#listItem\",\"name\":\"Getting To Know The MutationObserver API\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/getting-to-know-the-mutationobserver-api\\\/#listItem\",\"position\":3,\"name\":\"Getting To Know The MutationObserver API\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/#listItem\",\"name\":\"User Experience\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\",\"name\":\"Design for Immersive Technologies\",\"description\":\"User Experience for Games, Virtual Reality (VR) and Augmented\\\/Mixed Reality (AR\\\/MR)\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/\",\"name\":\"Guest Contribution\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/getting-to-know-the-mutationobserver-api\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d2aad73eb0f48c67b141e9fc978a0e498969791ed623346e361d02d19775b0bb?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Guest Contribution\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/getting-to-know-the-mutationobserver-api\\\/#webpage\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/getting-to-know-the-mutationobserver-api\\\/\",\"name\":\"Getting To Know The MutationObserver API | Design for Immersive Technologies\",\"description\":\"Getting To Know The MutationObserver APIGetting To Know The MutationObserver API Louis Lazaris 2019-04-26T13:30:16+02:002019-04-27T11:04:42+00:00In complex web apps, DOM changes can be frequent. As a result, there are instances where your app might need to respond to a specific change to the DOM. For some time, the accepted way to look for changes to the DOM\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/getting-to-know-the-mutationobserver-api\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.taterboy.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/logo-red-20.png?fit=60%2C80&ssl=1\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/getting-to-know-the-mutationobserver-api\\\/#mainImage\",\"width\":60,\"height\":80},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/04\\\/getting-to-know-the-mutationobserver-api\\\/#mainImage\"},\"datePublished\":\"2019-04-27T04:22:15-07:00\",\"dateModified\":\"2019-04-27T04:22:15-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/\",\"name\":\"Design for Immersive Technologies\",\"description\":\"User Experience for Games, Virtual Reality (VR) and Augmented\\\/Mixed Reality (AR\\\/MR)\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Getting To Know The MutationObserver API | Design for Immersive Technologies","description":"Getting To Know The MutationObserver APIGetting To Know The MutationObserver API Louis Lazaris 2019-04-26T13:30:16+02:002019-04-27T11:04:42+00:00In complex web apps, DOM changes can be frequent. As a result, there are instances where your app might need to respond to a specific change to the DOM. For some time, the accepted way to look for changes to the DOM","canonical_url":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/","robots":"max-image-preview:large","keywords":"user experience","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/#article","name":"Getting To Know The MutationObserver API | Design for Immersive Technologies","headline":"Getting To Know The MutationObserver API","author":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"publisher":{"@id":"https:\/\/www.taterboy.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/04\/logo-red-20.png?fit=60%2C80&ssl=1","width":60,"height":80},"datePublished":"2019-04-27T04:22:15-07:00","dateModified":"2019-04-27T04:22:15-07:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/#webpage"},"isPartOf":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/#webpage"},"articleSection":"User Experience"},{"@type":"BreadcrumbList","@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.taterboy.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/#listItem","name":"User Experience"}},{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/#listItem","position":2,"name":"User Experience","item":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/#listItem","name":"Getting To Know The MutationObserver API"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/#listItem","position":3,"name":"Getting To Know The MutationObserver API","previousItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/#listItem","name":"User Experience"}}]},{"@type":"Organization","@id":"https:\/\/www.taterboy.com\/blog\/#organization","name":"Design for Immersive Technologies","description":"User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","url":"https:\/\/www.taterboy.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author","url":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/","name":"Guest Contribution","image":{"@type":"ImageObject","@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/d2aad73eb0f48c67b141e9fc978a0e498969791ed623346e361d02d19775b0bb?s=96&d=mm&r=g","width":96,"height":96,"caption":"Guest Contribution"}},{"@type":"WebPage","@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/#webpage","url":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/","name":"Getting To Know The MutationObserver API | Design for Immersive Technologies","description":"Getting To Know The MutationObserver APIGetting To Know The MutationObserver API Louis Lazaris 2019-04-26T13:30:16+02:002019-04-27T11:04:42+00:00In complex web apps, DOM changes can be frequent. As a result, there are instances where your app might need to respond to a specific change to the DOM. For some time, the accepted way to look for changes to the DOM","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.taterboy.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/#breadcrumblist"},"author":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"creator":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/04\/logo-red-20.png?fit=60%2C80&ssl=1","@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/#mainImage","width":60,"height":80},"primaryImageOfPage":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/#mainImage"},"datePublished":"2019-04-27T04:22:15-07:00","dateModified":"2019-04-27T04:22:15-07:00"},{"@type":"WebSite","@id":"https:\/\/www.taterboy.com\/blog\/#website","url":"https:\/\/www.taterboy.com\/blog\/","name":"Design for Immersive Technologies","description":"User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.taterboy.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Design for Immersive Technologies | User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","og:type":"article","og:title":"Getting To Know The MutationObserver API | Design for Immersive Technologies","og:description":"Getting To Know The MutationObserver APIGetting To Know The MutationObserver API Louis Lazaris 2019-04-26T13:30:16+02:002019-04-27T11:04:42+00:00In complex web apps, DOM changes can be frequent. As a result, there are instances where your app might need to respond to a specific change to the DOM. For some time, the accepted way to look for changes to the DOM","og:url":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/","article:published_time":"2019-04-27T11:22:15+00:00","article:modified_time":"2019-04-27T11:22:15+00:00","twitter:card":"summary","twitter:title":"Getting To Know The MutationObserver API | Design for Immersive Technologies","twitter:description":"Getting To Know The MutationObserver APIGetting To Know The MutationObserver API Louis Lazaris 2019-04-26T13:30:16+02:002019-04-27T11:04:42+00:00In complex web apps, DOM changes can be frequent. As a result, there are instances where your app might need to respond to a specific change to the DOM. For some time, the accepted way to look for changes to the DOM"},"aioseo_meta_data":{"post_id":"64248","title":null,"description":null,"keywords":null,"keyphrases":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_custom_image_width":null,"og_custom_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"created":"2021-02-07 20:38:39","updated":"2026-09-01 09:25:25","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"twitter_image_url":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.taterboy.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/\" title=\"User Experience\">User Experience<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tGetting To Know The MutationObserver API\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.taterboy.com\/blog"},{"label":"User Experience","link":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/"},{"label":"Getting To Know The MutationObserver API","link":"https:\/\/www.taterboy.com\/blog\/2019\/04\/getting-to-know-the-mutationobserver-api\/"}],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8wzr5-gIg","jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/04\/logo-red-20.png?fit=60%2C80&ssl=1","_links":{"self":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts\/64248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/comments?post=64248"}],"version-history":[{"count":0,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts\/64248\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/media\/64249"}],"wp:attachment":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/media?parent=64248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/categories?post=64248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/tags?post=64248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}