Comments (1)
DOMContentLoaded 已经结束才进行监听就会无效。可以换成 alert 就可以看到是否执行了。
<div>
<script>
alert(1)
document.addEventListener('DOMContentLoaded', function() {
var jsSupported = document.getElementById('js-supported');
jsSupported.innerHTML = 'JavaScript is supported!';
jsSupported.style.color = 'green';
});
</script>
</head>
<body>
<div id="js-supported" style="font-size: 24px; text-align: center; margin-top: 50px;">
Checking JavaScript support...
</div>
<noscript>
<div style="font-size: 24px; text-align: center; margin-top: 50px; color: red;">
JavaScript is not supported on your browser.
</div>
</noscript>
</body>
</div>
from siyuan.
Related Issues (20)
- 改进移动端查看图片时划动
- 打开一张图片,好像会先加载完文档中的所有图片才能打开 HOT 1
- shift + enter 快捷键问题 HOT 4
- 搜索面板显示文档名称优化
- 数据库支持隐藏内容(不隐藏列) HOT 1
- Implement some delayed kernel events using task queues
- 改进代码块导出预览 HOT 6
- 数据库显示失败,一直在加载。 HOT 2
- [webdev] 有改动的之后,点击同步,第一次100% 提示错误,然后立马再点击一次就ok HOT 3
- Refresh the editor after rolling back the document
- 剪藏链滴和流云还有必要滚动页面吗? HOT 1
- 集市无法正常显示软链接插件 HOT 6
- 能不能在工具栏加一个按钮,点击一下随机打开一篇文章 HOT 1
- 支持在外观模式菜单中切换主题 HOT 1
- 行内代码前方的零宽空格没有正确跟随换行 HOT 3
- 在文档树右键文档,焦点不在文档树上,导致无法按 Delete 删除文档
- win10系统里,标题字重导致导出pdf的emoji缺失
- 建议列表项首使用退格键时,把内容合并在上一个列表项里 HOT 2
- 模板的属性列表解析失败
- 复制 A 数据库主键(已绑定块)粘贴到 B 数据库主键时,需要绑定块
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from siyuan.