Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery cookie for toggles not working for Internet Explorer
    primarykey
    data
    text
    <p>I have created a toggle page that the majority of users access via Internet Explorer, only the cookie which should save the last state of the toggles fails to work. I have attempted to use Intellectual Tortoise's fix, which only broke the toggle functionality. And after reading over the information on the W3C site about cookies left me with a deer-in-the-headlights expression.</p> <p>My issues are:</p> <ol> <li>The last state is not working in Internet Explorer browser, any version.</li> <li>I would like the state to persist and never expire in any browser.</li> </ol> <p>The js:</p> <pre><code> /toggle/ $(document).ready(function(){ $(".toggle_container").show(); $("h2.trigger").toggle(function(){ $(this).addClass("active"); }, function () { $(this).removeClass("active"); }); $("h2.trigger").click(function(){ $(this).next(".toggle_container").slideToggle("slow,"); }); }); /cookies/ $(".toggle_container").each(function() { $(this).toggle($.cookie('show-' + this.id) != 'collapsed'); }); $(".trigger").click(function () { var tc = $(this).toggleClass("active").next(".toggle_container").slideToggle("slow", function() { $.cookie('show-' + $(this).attr("id"), $(this).is(":hidden") ? 'collapsed' : 'expanded'); }); return false; }); </code></pre> <p>The html with employer-required censure:</p> <pre><code> &lt;h2 class="trigger"&gt;&lt;a href="#"&gt;Production&lt;/a&gt;&lt;/h2&gt; &lt;div class="toggle_container" id="pd"&gt; &lt;div class="block"&gt; &lt;table cellspacing="0" cellpadding="0" border="0"&gt; &lt;tr&gt; &lt;td&gt;Staff&lt;/td&gt; &lt;td&gt;PD&lt;/td&gt; &lt;td&gt;&lt;a href="https://snip/"&gt;https://snip/&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Service&lt;/td&gt; &lt;td&gt;PD&lt;/td&gt; &lt;td&gt;&lt;a href="https://snip/"&gt;https://snip/&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>Thanks in advance for your help.</p>
    singulars
    1. This table or related slice is empty.
    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. 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