1

This very basic page: http://www.marianotomatis.it/test.php does not render correctly in "some" IE versions.

<!DOCTYPE HTML>
<html>
<head><title>Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-    1.3.1.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.js"></script>
</head>
<body>
<div id="A" name="A">
 <div data-role="rangeslider">
    <label for="B">Range</label>
    <input type="range" name="B" id="B" min="0" max="100">
    <label for="C">Range</label>
    <input type="range" name="C" id="C" min="0" max="100">
 </div>
</div>
</body>
</html>

It stops on the script jquery.mobile-1.3.1.js in this line:

_sliderFirst = $.data( _inputFirst.get(0), "mobileSlider" ).slider,

with a SCRIPT5007 error ("Unable to get value of the property 'slider': object is null or undefined.")

I am using IE10 to debug and I have tested some combinations of Browser Mode (BM) and Document Mode (DM), to check the bad combinations. Hope this helps:

BM=IE10 DM=Standard [OK]
BM=IE9 DM=Standard [OK]
BM=IE8 DM=Standard [OK]
BM=IE7 DM=Standard [OK]
BM=IE10 DM=Non standard [OK]
BM=IE9 DM=Non standard [OK]
BM=IE8 DM=Non standard [OK]
BM=IE7 DM=Non standard [OK]
BM=IE10 DM=Standard IE9 [Error]
BM=IE9 DM=Standard IE9 [Error]
BM=IE8 DM=Standard IE9 [Error]
BM=IE7 DM=Standard IE9 [Error]
BM=IE10 DM=Standard IE8 [Error]
BM=IE9 DM=Standard IE8 [Error]
BM=IE8 DM=Standard IE8 [Error]
BM=IE7 DM=Standard IE8 [Error]
BM=IE10 DM=Standard IE7 [Error]
BM=IE9 DM=Standard IE7 [Error]
BM=IE8 DM=Standard IE7 [Error]
BM=IE7 DM=Standard IE7 [Error]

I have also tried to debug it with IE8 and it renders the page correctly. Thanks in advance for any suggestion.

2 Answers2

1

I had the same problem and I got rid of the errors in Internet Explorer when I've added data-type="range" to the inputs:

<input type="range" data-type="range" name="B" id="B" min="0" max="100">
0

This is a similar question to another asked against jQuery Mobile 1.3.0 "Error message with rangeslider in IE9 (JQuery Mobile)"

I've been able to reproduce this issue in jQuery Mobile v1.3.2 in IE10 (including WP8) and Chrome 28.

After a little digging in the JQM combined JS file, I found that the logic in several places is calling something like $.data( _inputFirst.get(0), "mobileSlider" ).slider if you step into that call stack you'll find at one point it checks for a variable to be undefined and if it is then is transposes the key ("mobileSlider") to camel-case and checks again. In this case the original key was camel-case and if it had been all lower-case with a hyphen ("mobile-slider"), it would have not failed.

To correct this issue in JQM v1.3.2, I've replaced the instances of "mobileSlider" with "mobile-slider" and now I have the expected behavior and working sliders and range sliders again.

Here are the lines and line numbers on which I've made the above change.

  1. jquery.mobile-1.3.1.js(7861): _sliderFirst = $.data( _inputFirst.get(0), "mobileSlider" ).slider,
  2. jquery.mobile-1.3.1.js(7862): _sliderLast = $.data( _inputLast.get(0), "mobileSlider" ).slider,
  3. jquery.mobile-1.3.1.js(7863): firstHandle = $.data( _inputFirst.get(0), "mobileSlider" ).handle,
  4. jquery.mobile-1.3.1.js(7919): $.data( this._inputFirst.get(0), "mobileSlider" ).dragging = true;
  5. jquery.mobile-1.3.1.js(7920): $.data( this._inputFirst.get(0), "mobileSlider" ).refresh( event );
  6. jquery.mobile-1.3.1.js(7932): $.data( otherSlider.get(0), "mobileSlider" ).dragging = true;
  7. jquery.mobile-1.3.1.js(7933): $.data( otherSlider.get(0), "mobileSlider" ).refresh( event );
  8. jquery.mobile-1.3.1.js(8006): $.data( otherSlider.get(0), "mobileSlider" ).handle.focus();
  9. jquery.mobile-1.3.1.js(8014): $.data( thisSlider.get(0), "mobileSlider" ).handle.css( "z-index", 1 );
  10. jquery.mobile-1.3.1.js(8015): $.data( otherSlider.get(0), "mobileSlider" ).handle.css( "z-index", 0 );
  11. jquery.mobile-1.3.1.js(8017): $.data( otherSlider.get(0), "mobileSlider" ).handle.css( "z-index", "" );
  12. jquery.mobile-1.3.1.js(8018): $.data( thisSlider.get(0), "mobileSlider" ).handle.css( "z-index", "" );
  13. jquery.mobile-1.3.1.js(8029): var min = parseInt( $.data( this._inputFirst.get(0), "mobileSlider" ).handle.get(0).style.left, 10 ),
  14. jquery.mobile-1.3.1.js(8030): max = parseInt( $.data( this._inputLast.get(0), "mobileSlider" ).handle.get(0).style.left, 10 ),
Community
  • 1
  • 1
Gio
  • 2,242
  • 1
  • 16
  • 13