今天在看JS面向对象的资料,碰到一个问题——javascript中name是什么?
?
XML/HTML代码
- <!DOCTYPE?HTML?PUBLIC?”-//W3C//DTD?HTML?4.01//EN”?”http://www.w3.org/TR/html4/strict.dtd”>??
- <html>??
- ????<head>??
- ????????<meta?http-equiv=“Content-Type”?content=“text/html;?charset=iso-8859-1”?/>??
- ????????<title>Untitled?Document</title>??
- ????</head>??
- ????<body>??
- ????????<script?type=“text/javascript”>??
- ????????????function?func()?{alert(‘Hello!’);}??????? ??
- ????????????????//alert(func.toString());? ??
- ????????????????func.name?=?“I?am?func.”;??????? ??
- ????????????????alert(func.name); ??
- ????????</script>??
- ????</body>??
- </html>??
在IE7下警告的信息是:I?am?func.而在FF3下警告信息却是函数名(对象):func。这是为什么呢
最新评论
写的挺好的
有没有兴趣翻译 impatient js? https://exploringjs.com/impatient-js/index.html
Flexbox playground is so great!
感谢总结。
awesome!
这个好像很早就看到类似的文章了
比其他的教程好太多了
柯理化讲的好模糊…没懂