我究竟做错了什么 ? -_-

警报显示,仅此而已。

    <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeaderContent">

        <script type="text/javascript">
            if (navigator.userAgent.match(/Android/i)) {
            }
            else if (navigator.userAgent.match(/webOS/i)) {
            }
            else if (navigator.userAgent.match(/iPhone/i)) {
            }
            else if (navigator.userAgent.match(/iPod/i)) {
            }
            else {
                alert("I'm a PC");
                $('#Label2').hide();
                $('#Label3').hide();
                $('#Label4').hide();
            }
       </script>

</asp:Content>

(...)

<div data-role="content">

            (...)

            <label id="Label1">
                Explanation to save it and/or bookmark (PC / Others)
            </label>
            <label id="Label2">
                Explanation to save it and/or bookmark (iOS)
            </label>
            <label id="Label3">
                Explanation to save it and/or bookmark (Android)
            </label>
            <label id="Label4">
                Explanation to save it and/or bookmark (BlackBerry)
            </label>
        </div>

最佳答案

如何将您的代码移到html下方?
或window.ready

关于javascript - 无法隐藏标签; jQuery查询,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8494837/

10-11 12:01