Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript code doesn't work in IE only
    primarykey
    data
    text
    <p>I have just verified my javascript code works fine in all browsers except IE. How is it possible that the script is correctly read and executed in Chrome, Safari... but IE finds some inexplicable error and refuses to run the code?</p> <pre><code>$(document).ready(function() { var NewsNavigator = { init: function(config) { this.news = config.news; this.newsNum = this.news.length; this.navbuttons = config.navbuttons; this.prevButton = config.prevButton; this.nextButton = config.nextButton; this.displayatonce = config.displayatonce; this.maxSteps = Math.ceil(this.newsNum / this.displayatonce); this.counter = 0; this.navigateNews(); this.enableNav(); this.checkButtonsVisibility(); }, showNews: function() { var start = this.counter * this.displayatonce; var end = this.counter * this.displayatonce + (this.displayatonce - 1); for (i=start; i&lt;=end; i++) { this.news.eq(i).show(); } }, hideAllNews: function() { console.log("hiding news"); this.news.hide(); }, navigateNews: function() { this.hideAllNews(); this.showNews(); }, checkButtonsVisibility: function() { if (this.counter &lt;= 0) { this.prevButton.css('visibility', 'hidden'); } else { this.prevButton.css('visibility', 'visible'); } if (this.counter &gt;= this.maxSteps - 1) { this.nextButton.css('visibility', 'hidden'); } else { this.nextButton.css('visibility', 'visible'); } }, enableNav: function() { self = this; this.navbuttons.on('click', function(event) { if (($(this).data('dir') === 'prev') &amp;&amp; (self.counter &gt; 0)) { self.counter--; self.navigateNews(); } else if (($(this).data('dir') === 'next') &amp;&amp; (self.counter &lt; self.maxSteps - 1)) { self.counter++; self.navigateNews(); } self.checkButtonsVisibility(); event.preventDefault(); }); } }; NewsNavigator.init({ news: $('div#cat-news').find('div.oneCol'), displayatonce: 3, navbuttons: $('div#nav').find('a'), prevButton: $('div#nav a.prec'), nextButton: $('div#nav a.succ') }); }); </code></pre> <p>Error message in IE9</p> <pre><code>SCRIPT438: The object doesn't support the 'checkButtonsVisibility' property or method. NewsNavigator.js, Row 69 Character 5 </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.
    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