5

关于网页的小笔记:Firefox、IE 和 JavaScript

 3 years ago
source link: https://yihui.org/cn/2007/10/notes-on-firefox-ie-and-javascript/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

关于网页的小笔记:Firefox、IE 和 JavaScript

谢益辉 / 2007-10-10


昨天半夜被一个 JavaScript 的问题迷惑了好一阵子,然后才反应过来,这又是 IE 和 Firefox 的差别。主要问题是,Firefox 对 document.all["id"] 这种获取页面内元素的方式并不太支持,而最好通过 document.getElementById("id") 这种更严格的方式来引用页面内的对象;对于 IE 而言,两种方式都可以。

之所以涉及到这个问题是因为我想在 HTML 页面中直接实现动画展示,省得还要费尽苦心去研究 GIF 文件格式然后读写 GIF 文件以便生成 GIF 动画文件,通过 JavaScript 的方式生成动画比研究 GIF 要容易多了,只需要调用 Java 脚本改变一幅图的 src 属性就足够了,然后用一个循环让图像 “动” 起来。示例参见:https://r.yihui.org/misc/java.htm 页面底部(点击按钮观看布朗运动)

黑猫警长・洗澡花 点儿守恒定律・冷天的大脚丫子・名字

Disqus Utterances Preferences

© Yihui Xie 2005 - 2020

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK