2 Replies - 465 Views - Last Post: 31 January 2012 - 06:15 PM

Topic Sponsor:

#1 DesLaw  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 31-January 12

Page now only works in IE compatibility mode

Posted 31 January 2012 - 02:56 AM

The following piece of script used to work in all browsers but I have just discovered that it is now u/s unless run in IE compatibility mode. No matter how many checkboxes have been checked it always ShowResults(1);


I have looked at it, stared at it and sworn at it.................. In truth I don't understand Java. Can anyone alble to help me get it working again.

Thanks
<script type="text/javascript">
    $(document).ready(function()
    {
        $('#btnSubmit').click(function()
        {
            var totalChecked = $('[name="chkChoice"][checked="true"]').length;
            
            if (totalChecked <= 7)
                ShowResults(1);
                
            if (totalChecked >= 8 && totalChecked <= 14)
                ShowResults(2);
                
            if (totalChecked >= 15 && totalChecked <= 21)
                ShowResults(3);
            
            if (totalChecked >= 22)
                ShowResults(4);
        });
		
		function ShowResults(resultPanelNumber)
		{
			$('#questionPanel').hide();
			$(document).scrollTop(220);
			$('#result_' + resultPanelNumber).show();
		}
    });  
  </script>

This post has been edited by smohd: 31 January 2012 - 03:58 AM
Reason for edit:: Code tags added. Please use [code] tags when posting codes


Is This A Good Question/Topic? 0
  • +

Replies To: Page now only works in IE compatibility mode

#2 smohd  Icon User is offline

  • Critical Section
  • member icon



Reputation: 1644
  • View blog
  • Posts: 4,126
  • Joined: 14-March 10

Re: Page now only works in IE compatibility mode

Posted 31 January 2012 - 04:02 AM

This is not Java, *Moved to Javascript*
Was This Post Helpful? 0
  • +
  • -

#3 e_i_pi  Icon User is offline

  • = -1
  • member icon

Reputation: 361
  • View blog
  • Posts: 1,020
  • Joined: 30-January 09

Re: Page now only works in IE compatibility mode

Posted 31 January 2012 - 06:15 PM

The code looks valid to me. My first suggestion would be to check the version of jQuery you are loading up (which is usually somewhere in your HTML headers). I had a problem recently that was due to using v1.5.1, which was resolved by using 1.7.1. Compatability errors with certain browsers are often addressed by the jQuery crew, so it's important to keep your jQuery library up to date.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1