随笔分类 - Javascript
摘要:有如下代码,结果看到了,不过不理解为什么会这样。 var f = [] for (i = 0; i < 3; i++) { f[i] = function() { alert(i) }; } f[0](); f[1](); f[2](); var ff = [] for (i = 0; i < 3; i++) { (fu...
阅读全文
摘要:把下面的函数放在页面中(任意位置都可以): function resizeimg(ImgD,iwidth,iheight) { var image=new Image(); image.src=ImgD.src; if(image.width>0 && image.height>0){ if(image.width/image.height>= ...
阅读全文
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Power Table First Name Last Name Team ...
阅读全文
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
阅读全文
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> ...
阅读全文
摘要:3种主要的原始值Boolean值、数字和字符串都有toString()方法。toString还可以带一个参数,也就是它的基模式。 采用Number类型的toString()方法的基模式,可以用不同的基输出数字。 JS测试页面 输出结果: 1111 17 15 f //////////////////////////////////////////////////////////////...
阅读全文