Dynamic divs not working in IE11
We're displaying data based on parameters in the URL string and it's working fine in Chrome and Firefox, but not in IE11. Here's what we have.
- CSS
- .welcomeNew{
- display:none;
- }
- .welcomeBack{
- display:none;
- }
- iQuery
- $(document).ready(function() {
- var visitor = new URL(location);
- var newvisitor = visitor.searchParams.get("v")
- if (newvisitor == '0') {
- $('.welcomeNew').show();
- $('.welcomeBack').hide();
- }
- else {
- $('.welcomeBack').show();
- $('.welcomeNew').hide();
- }
- });
- HTML
- <h1 class="welcomeBack">Welcome back</h1>
- <h1 class="welcomeNew">Welcome here</h1>