Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery clone() and 302 image sources -- how to avoid reloading in Firefox?
    primarykey
    data
    text
    <p>I have a group of images within a <code>&lt;div&gt;</code>. All these images are served through a 302 instead of a 200 for security purposes (servlet serving image based on authentication).</p> <p>I would like to clone that <code>&lt;div&gt;</code> and append it to another container.</p> <p>When doing so in all browsers except Firefox, the images are not reloaded. It appears those browsers understand it's the same image.</p> <p>In Firefox, each image is reloaded after the clone/append. I'd like to avoid that. Does anyone have any recommendations on how?</p> <p>UPDATED with code example:</p> <pre><code>&lt;div&gt; &lt;p&gt;&lt;button type="button" id="btn1"&gt;Clone 1&lt;/button&gt; &lt;button type="button" id="btn2"&gt;Clone 2&lt;/button&gt;&lt;/p&gt; &lt;/div&gt; &lt;div id="group1"&gt; &lt;div id="imgs"&gt; &lt;p&gt;&lt;img src="https://example.com/image/9c90434ed657427dad29"&gt;&lt;/p&gt; &lt;p&gt;&lt;img src="https://example.com/image/977b5dfe5e064880b164"&gt;&lt;/p&gt; &lt;p&gt;&lt;img src="https://example.com/image/8f22d7fd2a2343ab99c9"&gt;&lt;/p&gt; &lt;p&gt;&lt;img src="https://example.com/image/898c022e20b742c88ae6"&gt;&lt;/p&gt; &lt;p&gt;&lt;img src="https://example.com/image/8319fe1d23064b5d8011"&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="group2"&gt;&lt;/div&gt; &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#btn1").click(function(){ $("#imgs").clone().appendTo("#group1"); }); $("#btn2").click(function(){ $("#imgs").clone().appendTo("#group2"); }); }); &lt;/script&gt; </code></pre>
    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.
 

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