fixie icon indicating copy to clipboard operation
fixie copied to clipboard

Error with IE8

Open Benecke opened this issue 12 years ago • 3 comments

IE8 throws an error on 139 default: element.innerHTML = fixie_fetchPhrase();

Commenting out this line makes the script work in IE8.

Could it have to do with something mentioned here? http://learningswhileworking.blogspot.de/2010/05/javascript-default-key-word-problem.html

Benecke avatar Jul 04 '12 09:07 Benecke

[...]

case 'ol': case 'ul': element.innerHTML = fixie_fetchList(); break;

case 'hr': case 'input': case 'script': //case 'form': break;

default: //console.log(element); element.innerHTML = fixie_fetchSentence(); }

[...]

Cheers!

HAL-2001 avatar Apr 06 '13 23:04 HAL-2001

I haven't been able to reproduce this problem, and the problem cited in the blog post isn't an issue here (there is no "default" key). Would you like to elaborate?

ryhan avatar Apr 09 '13 19:04 ryhan

Here we go!

To reproduce the problem, for example, take a recent version of http://html5boilerplate.com/

Paste the following code:

<!-- Add your site or application content here -->
    <section class="fixie">
        <h1></h1>
        <p></p>
        <form>
            <input type="text" name="" value="">
            <input type="submit" name="" value="Go">
        </form>
    </section>

and of course ...

<script src="js/vendor/fixie.js"></script>

at the bottom. I'm using the "not minified" version here from github.

Now, IE8 throws an error on line 139: Meldung: Unbekannter Laufzeitfehler Zeile: 139 Zeichen: 13 Code: 0 URI: http://localhost/www/h5bp-dev/js/vendor/fixie.js

The error disappears when you modify the following code at line 135:

case 'hr':
case 'input':
break;

Or, as described by FYI "Commenting out this line [139] makes the script work in IE8."

~~I think there could be more elements that cause an error, not sure - but the Problem seems to be innerHTML when there is no "inner".~~

update also problems with:

    <div class="fixie">
        Text<br>
        boo!
        <noscript>
            Hello world!
        </noscript>
        <script src="js/dummy.js"></script>
    </div>

js:

case 'br':
case 'script':
case 'noscript':
break;

Cheers!

HAL-2001 avatar Apr 12 '13 22:04 HAL-2001