簡體   English   中英

noscript 僅在 Internet Explorer 中顯示

[英]noscript only displays in internet explorer

所以在 Wordpress 網站上,我正在研究 noscript 不應該顯示。 這適用於除 Internet Explorer 之外的所有瀏覽器。

使一些圖像出現兩次。

此代碼也出現在其他瀏覽器中,但不顯示:

<noscript>
     <img alt="image" src="www.---.jpg">
</noscript>

在這個上面,正常的 img 被加載了。 為什么它只在 IE11 上加載而不是在其他瀏覽器上加載,有沒有辦法對我的 style.css 文件中的 noscript 執行類似 display: none 或類似的操作

一種簡單的方法是使用 javascript 隱藏圖像:

向此圖像添加 id 屬性:

<img id="noscriptImg" alt="image" src="www.---.jpg">

和 javascript:

window.onload=function(){document.getElementById("noscriptImg").style.display="none";};

更新:

根據www.w3shools.com ,如果 noscript 標簽位於 head 部分,則 noscript 標簽只能包含<link>, <style>, and <meta>元素。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM