76769

Jquery fails to hide div in IE10 running in IE7 document and browser mode

Question:

I have written a small jQuery script that queries the url to see if it contains certain text (in this case a PL/SQL generated parameter and value). If so, the script hides a div in the page content and adjusts the adjacent divs to fill the space left by the now absent div. My current issue is that for some reason the script isn't working in IE7 despite working in all other browsers.

<script type="text/javascript"> $(document).ready(function () { if(window.location.href.indexOf("p_ccp_path=APPLY") != -1){ $(".page-content-right").hide(); $("#right-col").css("width","60%"); $("#icams-inserted").css("width","100%"); } }); </script>

I'm using a localised version of jQuery 1.10.2 and the page on which this error is occurring can be found here:

<a href="http://tinyurl.com/jqueryError" rel="nofollow">http://tinyurl.com/jqueryError</a>

Any ideas?

Additional:

I've checked Firebug and there are no errors. However, when I check the IE developer tool it comes up with the following error:

SCRIPT3: Member not found jquery.min.js, line 5 character 8860

Additional2:

From some of the comments, it appears that this may be an issue with the IE10 render as IE7 mode. I'm going to test this on a Vanilla version of IE7 on virtual box to make sure that this is the case.

Answer1:

It would appear that this is a bug with IE10 itself rather than there actually being any errors in my code. Testing a stock version of IE7 on a remote machine showed that the script does indeed work on IE7 without a hitch.

To ensure that the issue does not persist if users are running their browser in compatability mode, I have used the following meta tag:

<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />

This ensures that the most recent version of IE standards mode is used when running in IE compatibility mode through the use of the 'Edge' specification.

Credit to @MythThrazz for the suggestion that it may be an issue with the IE10 compatability mode.

Answer2:

Googling for the error code points to this url: <a href="http://bugs.jquery.com/ticket/12577" rel="nofollow">http://bugs.jquery.com/ticket/12577</a>

The error may not related with the part of the code you've posted.

Answer3:

I suspect the problem is .indexof().

It is supposed to be camel-case, so it should be .indexOf() (with a capital O). Javascript cares about this sort of thing, so I'm surprised if that would work in <em>any</em> browser.

Recommend

  • Compare a column between 2 csv files and write differences using Python
  • Select multiple items in JTextPane
  • href inside href [duplicate]
  • Textbox validation in jquery
  • use a single handler for multiple inputs onChange events
  • how to check the textarea content is blank using javascript?
  • changes in jquery 1.4.2 breaking the code?
  • getelement by class name for clicking
  • when does setTimeout start executing in a inline
  • pythonanywhere - How do I use websockets to transmit messages as per the web2py messaging example?
  • how to ignore xml namespaces?
  • Is looping through all style sheets and classes a good idea in JavaScript?
  • Making Google Visualization - Annotation Chart to work in GWT
  • Cannot get text from text area
  • Getting error 'Cannot read property 'document' of undefined' while importing exp
  • How can I restyle a word when rendering a pdf with pdf.js?
  • Uncaught TypeError: $(…).select2 is not a function
  • Suppressing passwd when calling sqlplus from shell script
  • Remove changes from one element when event occurs on another element?
  • Button click event not firing in jQuery
  • Tamper-proof configuration files in .NET?
  • Reduction and collapse clauses in OMP have some confusing points
  • gspread or such: help me get cell coordinates (not value)
  • Chart.js Multiple dataset
  • How do I get HTML corresponding to current DOM tree?
  • chrome.tabs.executeScript only fires when the Developer Console is open
  • MongoDb aggregation
  • JQuery Internet Explorer and ajaxstop
  • JSON response opens as a file, but I can't access it with JavaScript
  • How to use remove-erase idiom for removing empty vectors in a vector?
  • Android full screen on only one activity?
  • Modifying destination and filename of gulp-svg-sprite
  • Change an a tag attribute in JavaScript based on screen width
  • align graphs with different xlab
  • WPF Applying a trigger on binding failure
  • NSLayoutConstraint that would pin a view to the bottom edge of a superview
  • CSS Applying specific rule for a specific monitor resolution with only CSS is posible?
  • How get height of the a view with gone visibility and height defined as wrap_content in xml?
  • Change div Background jquery
  • python draw pie shapes with colour filled