0

A client has a few machines set to different browser and document modes. This is affecting a Javascript function:

$(".jumpmenu").change(function() {
    var val = $(this).val();
    if (val != '') {
        location.href=val;
    }
});

The function does not run when this is the case. I have set my IE to the same and can confirm that the change does not happen.

My first question is why would an IT department set the browser and document modes differently.

Secondly is there anything I can do to quickly fix the problem without making them change their doc and browser modes?

regards.

rmccallum
  • 214
  • 3
  • 18
  • I take it `".jumpmenu"` is a ` – nnnnnn Jun 19 '13 at 11:11
  • Yes, sorry the .jumpmenu is a select with a number of options that should send the user to a different part of the page with #option replcing what was on the page with the #option elements. Sort of show & hide – rmccallum Jun 19 '13 at 11:18
  • Older IE did not deliver a `.value` attribute for select elements - so if jQuery just looks at that attribute, it will not get the value of the selected option. Either rewrite your code so that it actually looks for the selected option element and reads its value - or try to force document mode by using `X-UA-Compatible` meta element (or HTTP header). – CBroe Jun 19 '13 at 12:05
  • Thanks. I added in the option:selected to get the value but with IE8 Browser mode and IE7 doc mode still there was an issue. Will look at the compatible option. – rmccallum Jun 19 '13 at 13:21

0 Answers0