Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTed Weddell
Courses Plus Student 331 Pointsie-emulation-modes-warning.js is not mentioned in this lesson
I'm guessing another script has been added to Bootstrap since this course was published. At the point of removing IE 9 scripts I have...
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="../../assets/js/ie-emulation-modes-warning.js"></script>
There is no mention of the script outside the [if] statement, so not sure what I should do with it. For now I'm just adding it below where I hooked the other scripts, in functions.php, and commenting it out, until I know otherwise how to treat it.
UPDATE: In the footer I found ...
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
Same as above, I'm commenting it out in functions.php until I know what to do with it.
5 Answers
Zac Gordon
Treehouse Guest TeacherThere are conditional statements you can use for this :)
Check this out https://gist.github.com/wpscholar/4947518
Christine Schneider
234 PointsI have the same question, but do not quite know what I should do - the link to the Github page confuses me as it is just outside my depth of understanding.
What exactly should I do with this line:
<script src="../../assets/js/ie-emulation-modes-warning.js"></script>
Also, what is the effect of completely deleting the line anyway?
mark mun
5,026 PointsI just and went ahead and added this code to the footer.php
<code> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <script> if (navigator.userAgent.match(/IEMobile\/10.0/)) { var msViewportStyle = document.createElement('style') msViewportStyle.appendChild( document.createTextNode( '@-ms-viewport{width:auto!important}' ) ) document.querySelector('head').appendChild(msViewportStyle) } </script>
</code>
Ted Weddell
Courses Plus Student 331 PointsThanks Zac. I assumed they should be conditional but wasn't sure, since they are not conditional in the original Bootstrap files. So... conditional they shall be.
By the way, I really enjoy your courses. You're very thorough, easy to understand, and you make learning fun!
Seray W
3,063 PointsHey, could you possibly please post a picture of what you did, I was looking through the Github page but I was very confused :)
Ant贸nio Magalh茫es
4,695 Pointsi made download of the archive - ie10-viewport-bug-workaround.js to the folder "JS". And added this: wp_enqueue_script( 'bootstrap_js', get_template_directory_uri() . '/js/ie10-viewport-bug-workaround.js', array('jquery'), '' , true);
is this right?
Paul Crow
21,558 PointsPaul Crow
21,558 PointsThis is my functions.php file for the lesson after applying conditionals to the new .js files involving IE debugging/workarounds. The two javascript files are part of the local directory structure so they're wp_enqueue script, not wp_register_script. Then when adding their data, be sure your conditional is correct (Is it less than 'lt' IE 9, or is it IE10 specific?)