问题标签 [noscript]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
899 浏览

javascript -

Does anyone know why this doesn't work in IE6?:

#xA;

It seems simply enough, but unlike FF, IE6 doesn't show it when I disable javascript.

It's really confusing :( I thought the tag was supposedly compatible acrosss browsers? Well, atleats from the W3 profile page for the tag. (http://www.w3schools.com/tags/tag_noscript.asp)

Any help would be great! Fiton

0 投票
5 回答
662 浏览

javascript - no script tag vs server side validation?

this is a question that hasn't directly been asked yet..
I develop for a company which serves millions of web customers per year. Many of our web applications were written years ago (and with bad practice) that relies entirely on java-script for the pages to work, most notably web form validation.

Recently, we've been implementing noscript tags to re-direct users to an error page if they don't use javascript.
I am having trouble convincing anyone why server validation should occur alongside client validation instead of using noscript given 99% of users now have javascript enabled browsers.

Plus, adding in an opening and closing tag and a re-direct can be developed in 5 seconds whereas server validation requires a lot more time and money.
What're your thoughts??
What is the real advantage of server validation if we now have noscript besides the 1% of users who will just have to enable their scripting?

0 投票
3 回答
1454 浏览

javascript - 如何调试 noscript 标签

我正在制作一个小部件,我用 noscript 标记包装了一些 JavaScript,现在我只是得到一个空白屏幕,没有我能注意到的错误消息。

这是示例:http ://www.comehike.com/outdoors/widget.php?hike_id=108&height=600&width=700

如果您从该页面的视图源粘贴 url,您会发生一些事情。但由于某种原因,我链接到的这个 url 什么也没显示。为什么会这样?

谢谢!!

0 投票
1 回答
150 浏览

list - 如何合并两个包含简单列表的文件?

对于 Google Chrome 浏览器,我使用了一个名为 NotScripts 的扩展程序,它允许您只为您放在白名单上的网站启用 javascript(反之则使用黑名单)。由于没有用于跨平台合并多个 NotScripts 实例的云帐户,因此我必须手动执行此操作。

因此,我已将 OSX Google Chrome 上的一个 NotScripts 实例的白名单复制并粘贴到一个名为 whitelist-a.txt 的文本文件中,并将 Windows Google Chrome 上的另一个 NotScripts 实例复制并粘贴到一个名为 whitelist-b.txt 的文本文件中。

白名单-a.txt -

白名单-b.txt -

如您所见,这两个列表之间存在一些相似之处。我不想合并列表以便list a覆盖list b,但我希望这两个列表合而为一,如下所示:

有没有我可以运行的问题或脚本来做到这一点?我不精通行命令,也找不到任何插件或脚本来执行此操作。

0 投票
2 回答
4620 浏览

javascript - 使用

I noticed Facebook does this where they have a meta refresh enclosed in a <noscript> enclosed in the <head> tag. They use this to detect if the user agent has javascript enabled or not.

We were thinking of using this method for 2 reasons:

  1. To auto redirect to a non-js optimized version of the site as facebook does.
  2. To include a non-js stylesheet to hopefully disable the finger pointer over javascript only anchors as well as for CSS3 complaint browsers, fading those buttons out to make it more obvious they are disabled (not working rather).

Will using this method for the above reasons cause any adverse effects that will affect a large percentage of user agents?

0 投票
2 回答
694 浏览

html - 在没有javascript的情况下检测是否有溢出

我想知道是否有一种HTML/CSS 唯一的方法来检测(或至少,显示/隐藏一些带有伪类的元素等)以在元素的内容溢出时采取行动(仅限垂直)。是的,我知道它可以完成并且我知道如何去做(我不需要 JS 示例,请),我只想知道是否有一个聪明的方法,没有任何javascript。

我试图显示一个“更多...”按钮,该按钮仅在溢出时出现,并尽可能在没有 JS 的情况下实现这一点。

0 投票
1 回答
6712 浏览

html - 固定元素在滚动时移动到页面顶部 - 仅限 CSS

我正在寻找在此页面上产生的效果:http: //jonrohan.me/guide/css/creating-triangles-in-css/ - 但只有 CSS,没有 JavaScript(这对于 JavaScript 来说是微不足道的) .

我说的效果如下:

  • 最初,您会看到页眉和文章标题。
  • 当您滚动页眉时消失。
  • 文章标题固定在页面顶部,因此您在滚动时始终可以看到它。

到目前为止,我取得的最好成绩是:http:
//jsfiddle.net/nottrobin/2FSvx/
但我不喜欢<nav>我的解决方案中固有的重复。

有没有人可以想到任何聪明的 CSS/3 技术来实现它,以便当您向下滚动并<header>消失时,<nav>自然会爬到页面顶部?

0 投票
2 回答
212 浏览

javascript - 我该如何处理?代码不验证:Noscript 来弥补 JS 的不足,同时也为移动用户提供便利

好的,所以我有一个包含一些文本的段落标签,文本是指用户可以查看导航的方向(我知道这是不必要的,但无论如何)。现在,我试图用 1 块石头杀死 2 只鸟,方法是使用 javascript 将这个值从本质上的“左”更改为“顶部”(导航通常在左边,而在 iPhone 上,例如,它在上面);但是当我尝试使用 noscript 时效率就会提高。

例子:

很酷的是,innerHTML 删除了 span.navdir 的子节点,它是 noscript 标记(以及它的内容)!我的句子对缺乏 javascript 的人以及使用 iphone 的人或两者都友好!

我很高兴,直到我发现它没有验证。我用谷歌搜索了这个,这是关于 noscript 实际上是一个块标记,不能在 p 或 span 等内的事实。

如何在保持新创建效率的同时验证这一点?

0 投票
2 回答
343 浏览

javascript - 尝试使用 noscript 的替代方法;很好,但不是在移动浏览器中?

我最近发现了一种非常简单的方法来在代理禁用 javascript 时显示消息,而且效果很好——在我的笔记本电脑上..!

我在移动 safari 上测试了它,它不起作用。有什么理由不这样做吗?我在编写代码时考虑了这些事情:

  1. 标记/dom 实际加载/注册,所以我在 div 的结束标记之后放置了一个脚本标记
  2. 它不应该立即工作的任何类型的原因,所以我使用了 setTimeout 函数并让它等待 100 毫秒
  3. 使用 jquery 只是以防旧的 dom 查找和样式修改的东西没有表现得那么好/正确

我的代码:

提前谢谢各位。

编辑:

我确认问题不在于 Webkit;以及使用自调用匿名函数或将隐藏代码放在 window.onload 中而不是在 div 的结束标记之后开始它没有区别的事实。

编辑2:

确认执行 document.getElementById 并将 display 设置为 none 也不起作用!到底是怎么回事...

0 投票
2 回答
117 浏览

javascript - 需要一个根据浏览器启用/禁用的 javascript 工作的链接

style-sheet and <noscript>如果禁用了 javascript,我已经实现了一个警报弹出窗口。弹出窗口有警告消息和确定按钮。在所有浏览器中禁用 javascript 之前,确定按钮将不起作用。当启用 javascript 并且不重新加载页面时

On FF:-单击确定按钮页面会重新加载

Other Browsers:-单击确定按钮没有任何反应

我希望我的 Ok 按钮在所有其他浏览器(IE、Opera、Safari、Chrome)中的行为都像 FF,我该如何实现?

编辑我的代码如下