Jump to content

jQuery not executing function on ready in IE


everisk

Recommended Posts

Hi,

 

I have the below code that should run on ready(). It works fine on Firefox but not IE :( Any ideas?

 

THank!

 

<script type="text/javascript">
$(document).ready(
function() {
	var $items = ['regular', 'outsource', 'total_headcount', 'internal', 'external', 'resigned', 'eligible', 'member', 'valoptec_percent'];

	$($items).each(function() {
		totalIt(this);
	});
}
);

You need to add a '#' to your selector. Try it like this.

<script type="text/javascript">

$(document).ready(

  function() {

      var items = ['regular', 'outsource', 'total_headcount', 'internal', 'external', 'resigned', 'eligible', 'member', 'valoptec_percent'];

 

      $.each(items, function() {

        totalIt('#'.this);

      });

  }

);

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.