简体   繁体   中英

noscript tag not working on iPad and iPod

I have used noscript tag on master page head section which shows a message when scripting is disabled on clients browser its working on all device like windows phone and mac PC but, it is show html tags on iPad and iPod when I disable the JavaScript from browser but after refreshing the page it shows the message which one I have placed in noscript tag. I could not understand what is it for, is there anyone have solution ? thanks in advance!

     <noscript>
        <div class="notify-container" id="Div1">
            <div id="Div2">
                <span class="notify-close" id="Span1"></span><span class="notify-text" id="Span2">
                    <asp:Label runat="server" ID="JavascriptNotEnabledNotification"></asp:Label></span>
            </div>
        </div>
    </noscript>

above script show the following notification when I disable the JavaScript.

在此处输入图片说明

I am using above tags, it is working in right manner but problem is that when I disable the JavaScript on iPad and iPod devices then above tags are showing on page, instead of showing message.

on iPad and iPod the same page showing the tags instead of notification bar given in following snapshot

在此处输入图片说明

is it noscript tag problem in iPad and iPod or tags are not getting css ?

I would consider

<html>
  <head>
    <script>
      document.write('<style>.noScript { display:none }</style>');
    </script>
  </head>
  <body>
    <div class="noScript">Your browser has JS <span style="display:none"> and CSS</span> disabled</div>
  </body>
</html>

将您的noscript移到标记内,这样可以解决此问题。

You could instead hide the content you want to display if JavaScript is disabled in your script. For example, in jQuery:

$(document).ready(function(){
    $('.noscript').hide();
});

This code will not run if the user has Javascript disabled, thus showing your content.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM