Note that there are some explanatory texts on larger screens.

plurals
  1. POStrange behavior with wrapAll() on some pages
    primarykey
    data
    text
    <p>I'm trying to wrap everything inside a page's <code>&lt;body&gt;</code> tag in a div called bodySemex. For most pages, this works fine:</p> <pre><code>$('body').children().wrapAll('&lt;div id="bodySemex" /&gt;') </code></pre> <p>However, on some pages, this causes the body element to disappear altogether. (For example, avc.com and <a href="http://www.theatlantic.com/technology/archive/12/07/how-the-gorgeous-sometimes-fictional-sound-of-the-olympics-gets-made/259742/" rel="nofollow noreferrer">http://www.theatlantic.com/technology/archive/12/07/how-the-gorgeous-sometimes-fictional-sound-of-the-olympics-gets-made/259742/</a> both disappear as a result of this line of code.</p> <p>I get an error message each time this happens; the message seems to indicate that jQuery's <code>each()</code> function is trying to operate on something that's undefined.</p> <pre><code>Uncaught ReferenceError: _gat is not defined (anonymous function) e.extend.globalEval chrome-extension://clcjngnadninklpbdkjccpoenjdomnid/js/jquery.js:2 e.extend.globalEval chrome-extension://clcjngnadninklpbdkjccpoenjdomnid/js/jquery.js:2 bp chrome-extension://clcjngnadninklpbdkjccpoenjdomnid/js/jquery.js:2 e.extend.each chrome-extension://clcjngnadninklpbdkjccpoenjdomnid/js/jquery.js:2 f.fn.extend.domManip chrome-extension://clcjngnadninklpbdkjccpoenjdomnid/js/jquery.js:4 f.fn.extend.prepend chrome-extension://clcjngnadninklpbdkjccpoenjdomnid/js/jquery.js:3 f.each.f.fn.(anonymous function) chrome-extension://clcjngnadninklpbdkjccpoenjdomnid/js/jquery.js:4 (anonymous function) chrome-extension://clcjngnadninklpbdkjccpoenjdomnid/js/distillery.js:365 e.extend.each chrome-extension://clcjngnadninklpbdkjccpoenjdomnid/js/jquery.js:2 e.fn.e.each chrome-extension://clcjngnadninklpbdkjccpoenjdomnid/js/jquery.js:2 bodySwap (Note, this is the name of the line of code the this question is about) </code></pre> <p>I have searched SO for similar issues and tried some alternatives to wrapAll (for example, the alternatives discussed here: <a href="https://stackoverflow.com/questions/3835718/jquery-wrapallinner-or-wrapall-applied-interally">Jquery wrapAllInner() ? -- Or wrapAll() applied interally?</a> )</p> <p>Thanks for any help you can provide!</p>
    singulars
    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.
 

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