everisk Posted November 26, 2009 Share Posted November 26, 2009 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); }); } ); Link to comment https://forums.phpfreaks.com/topic/183029-jquery-not-executing-function-on-ready-in-ie/ Share on other sites More sharing options...
JustLikeIcarus Posted November 26, 2009 Share Posted November 26, 2009 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); }); } ); Link to comment https://forums.phpfreaks.com/topic/183029-jquery-not-executing-function-on-ready-in-ie/#findComment-966086 Share on other sites More sharing options...
.josh Posted November 26, 2009 Share Posted November 26, 2009 I made a dummy totalIt() function that just alerts the value. All of the values in the array alerted for me in IE8 and IE7. Perhaps you should explain what doesn't work. Link to comment https://forums.phpfreaks.com/topic/183029-jquery-not-executing-function-on-ready-in-ie/#findComment-966111 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.