Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A bare, unescaped <code>&amp;</code> is simply invalid HTML. There is no reason ever to include one in markup.</p> <p>Any browser, when it sees a <code>&amp;</code> that is not part of an entity reference, will fix it up for you to correct your mistake. This happens at parse time, either when loading the document, or on setting <code>innerHTML</code> as <code>html()</code> and <code>append()</code> do.</p> <p>The browser does not remember your original markup, but only a set of objects and properties (the ‘DOM’) that reflects the current state of the page. These objects are populated by parsing your input HTML, but if you fetch markup by reading <code>innerHTML</code> or <code>html()</code> you will get a freshly-serialised set of markup created from the DOM objects and <strong>not</strong> the markup you originally put in. You will see differences in whitespace, attribute order, and any mistakes in the original markup will be fixed.</p> <p>When you interact with the document from script, on the level of properties, <code>attr()</code> or <code>text()</code>, you're going directly to the DOM without asking it to serialise the information it has back into HTML markup. In that case you will get on-page ampersands as simple <code>&amp;</code>, not escaped. So naturally in this case your regexp will not find any to replace; there is simply <strong>no ‘underlying markup’</strong> for you to make edits to.</p> <p>So the real question is really, what string are you ending up with that is ‘making the code fail’, and how is that being handled? This isn't visible in the posted question.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload