本文介绍了noscript是否通过支持JavaScript的浏览器得到确认?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究通过将其移至外部jQuery脚本来收紧我们的广告代码,但我显然仍需要一些HTML来定位广告。所以我想知道我是否可以定位一个noscript元素(或者在noscript元素中),因为我不得不在页面上留下它,或者如果我需要为JavaScript定位一些其他元素?

I'm looking into tightening up our ad code by moving it to an external jQuery script, but I obviously still need some HTML to target the ad to. So I was wondering if I can target a noscript element (or within a noscript element) since I'm going to have to leave that on the page anyway, or if I need to have some other element for the JavaScript to target?

<noscript>
  <div class="ad"><a href="foo"><img src="bar" alt="ad" /></a></div>
</noscript>

我的意图是更改或剥离noscript元素。

My intention would be to change or strip the noscript element.

推荐答案

< noscript> 内容不仅仅在JS激活时不显示,它显然也不在DOM。我尝试访问< noscript> 区域中的内容(希望您可以使用jQuery来 clone>()>并插入它别的地方),但没有收到任何东西。

<noscript> content is not only not displayed when JS is active, it apparently is also not in the DOM. I tried accessing content inside a <noscript> area (hoping you could clone() it with jQuery and insert it somewhere else) but got back nothing.

这篇关于noscript是否通过支持JavaScript的浏览器得到确认?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 23:38