简体   繁体   中英

noscript only displays in internet explorer

so on the Wordpress site I'm working on the noscript is not supposed to be shown. this works properly on every browser but Internet Explorer.

making a some images appear twice.

this code appears also in other browsers but doesn't show:

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

with above this one the normal img getting loaded in. why does it only load in on IE11 and not on other browsers and is there any way to do something like display: none or something like that to the noscript inside my style.css file

A simple way is using javascript to hide the image:

Add an id attribute to this image:

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

And the javascript:

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

Update:

According www.w3shools.com the noscript tag can only contain <link>, <style>, and <meta> elements, if the noscript tag is in the head section.

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