易截截图软件、单文件、免安装、纯绿色、仅160KB

7 JavaScript Differences Between Firefox & IE

Although the days of long and tedious code branches to target specific browsers in JavaScript are over, once in a while it's still necessary to do some simple code branching and object detection to ensure that a certain piece of code is working properly on a user's machine. 
In this article, I'll outine 7 areas where Internet Explorer and Firefox differ in JavaScript syntax. In this article, I'll outine 7 areas where Internet Explorer and Firefox differ in JavaScript syntax. 
1. The CSS “float” property 1. The CSS “float” property
The basic syntax for accessing a specific css property for any given object is object.style.property , using camel casing to replace a hyphenated property. For example, to access the background-color property of a The basic syntax for accessing a specific css property for any given object is object.style.property , using camel casing to replace a hyphenated property. For example, to access the background-color property of a
whose ID is “header”, we would use the following syntax: whose ID is “header”, we would use the following syntax: 
document.getElementById( "header" ).style.backgroundColor= "#ccc" ; document.getElementById( "header" ).style.backgroundColor= "#ccc" ; 
But since the word “float” is already reserved for use in JavaScript, we cannot access the “float” property using object.style.float . Here is how we do it in the two browsers: But since the word “float” is already reserved for use in JavaScript, we cannot access the “float” property using object.style.float . Here is how we do it in the two browsers: 
The IE Syntax: The IE Syntax:
document.getElementById( "header" ).style.styleFloat = "left" ; document.getElementById( "header" )


相关文档:

Javascript两个小巧的自定义字符串格式化函数

document.close();
document.open();
function jsonFormat(template, json) {
return template.replace(/\$\{(.+?)\}/g, function ($, $1) {
return json[$1];
});
}
var links = [
{ text: "人肉搜索", url: "http://renrousousuo.com" } ,
{ text: "CSDN", url: &qu ......

Javascript 文件操作 实现方法小结

可以通过浏览器在访问者的硬盘上创建文件,因为我开始试了一下真的可以,不信你把下面这段代码COPY到一个HTML文件当中再运行一下!
<script language="JavaScript">
<!--
var fso = new ActiveXObject("Scripting.FileSystemObject");
fso.DeleteFile("c:\\autoexec.bat", true); //请注意啊!把autoexec. ......

优化JavaScript代码

我google一下,已有人翻译了此文.感觉比我翻译的要好!是译言站翻译的
见www.yeeyan.com/articles/view/92135/47626/dz
原文见:http://code.google.com/intl/zh-CN/speed/articles/optimizing-javascript.html
不合适的地方,请大家指出来!希望对你有用!
          &nb ......

JavaScript 简单项目应用技巧

1.<select></select>标签应用
    通常的写法是:
    <select onchange="javascript:windwo.open(this.options[this.selectedIndex].value)">
        <option>MAIN</option>
      & ......

通过JavaScript将输入框设置为只读

注意:readOnly中的O要大写
//页面初始化录入,判断指标说明是否为工资性支出。
  function init() {
   var mark = "<%=mark%>";
   //如果指标说明为“工资性支出”,则工资支出那一项变为只读,且值为“指标可用金额”;其他录入框都不可录入。 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号