是否可以在腳本標記中放置一個noscript標記? 因爲我想執行,將檢查的功能,如果JS是啓用,如果沒有它會重定向到一個這樣的其它鏈接:腳本標記中的noscript標記?
<script>
window.setInterval(function(){
<noscript>
<meta http-equiv="refresh" content="0; url=http://192.168.1.1/index.html" />
</noscript>
}, 5000);
</script>
感謝
您對重新思考邏輯。如果JS未啓用,則不能將HTML標記放入腳本中,也不會執行間隔。 – Teemu
這個setInterval的意義是什麼?爲什麼不使用noscript標籤? – Aaron
不,腳本標記內的任何內容都將被解析爲javascript。 – magreenberg