方法转换IE、Firefox、Chrome区别
2012-01-17 16:28
274 查看
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
5 <title></title>
6 <script type="text/javascript">
7 var person1 = {
8 toLocaleString:function () {
9 return "Nikolaos";
},
toString:function () {
return "Nicholas";
}
};
var person2 = {
toLocaleString:function () {
return "Grigorios";
},
toString:function () {
return "Greg";
}
};
var people = [person1, person2];
console.log(people);
console.log(people.toString());
console.log(people.toLocaleString());
</script>
</head>
<body>
</body>
</html>
IE下显示
Nicholas,Greg
Nicholas,Greg
Nikolaos, Grigoriosfirefox、chrome下显示
Nicholas(Object),Greg(Object)
Nicholas,Greg
Nikolaos, Grigorios
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
5 <title></title>
6 <script type="text/javascript">
7 var person1 = {
8 toLocaleString:function () {
9 return "Nikolaos";
},
toString:function () {
return "Nicholas";
}
};
var person2 = {
toLocaleString:function () {
return "Grigorios";
},
toString:function () {
return "Greg";
}
};
var people = [person1, person2];
console.log(people);
console.log(people.toString());
console.log(people.toLocaleString());
</script>
</head>
<body>
</body>
</html>
IE下显示
Nicholas,Greg
Nicholas,Greg
Nikolaos, Grigoriosfirefox、chrome下显示
Nicholas(Object),Greg(Object)
Nicholas,Greg
Nikolaos, Grigorios
相关文章推荐
- 各种浏览器(IE,Firefox,Chrome,Opera)COOKIE修改方法[转]
- document.getElementById方法在Firefox与IE中的区别。
- chrome,FireFox与IE中的不兼容问题以及解决方法——(不断更新)
- 各种浏览器(IE,Firefox,Chrome,Opera)COOKIE修改方法[转]
- JS实现pasteHTML兼容ie,firefox,chrome的方法
- IE和FIREFOX下CSS的区别与解决方法第1/2页
- 常见浏览器兼容问题及相关解决方法(chrome/IE/firefox)
- ajax中获取XMLHttpRequest对象的方法(IE/Firefox/chrome)
- FireFox和IE的JavaScript方法的区别
- 跟随页面滚动的div(firefox,ie,chrome),兼给setTimeout传递参数的方法
- firefox和ie中getElementById方法的区别
- windows8.1 打不开网页 除ie外打不开网页 firefox chrome 打不开网页解决方法
- uploadify在ie,chrome等浏览器上传文件成功,而firefox出现http error 404问题的解决方法
- 自定义复选框、单选按钮外观方法。支持IE、Firefox、chrome
- JavaScript的常见兼容问题及相关解决方法(chrome/IE/firefox)
- IE和FireFox 在 编程方面的区别及解决方法
- margin在IE、Firefox、Chrome、Safari下兼容的超级方法!
- 各种浏览器(IE,Firefox,Chrome,Opera)COOKIE修改方法[转]
- chrome、firefox、IE 处理input 光标的区别