发布于 2016-12-22 01:14:15 | 107 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的Javascript教程,程序狗速度看过来!

JavaScript客户端脚本语言

Javascript 是一种由Netscape的LiveScript发展而来的原型化继承的基于对象的动态类型的区分大小写的客户端脚本语言,主要目的是为了解决服务器端语言,比如Perl,遗留的速度问题,为客户提供更流畅的浏览效果。


昨天在项目中发现IE6动态生成的INPUT是不能改NAME的,微软关于这个问题有这么个说法
The NAME attribute cannot be set at run time on elements dynamically created with the createElement method.
To create an element with a name attribute, include the attribute and value when using the createElement method.
也就是说,你得这么写
 
document.createElement('<input type="text" name="username" >'); 

看起来都觉得不爽,而且不支持FF.
如果你使用了Jquery的clone方法,然后想在复制之后修改元素的name属性,那是不会成功的,简单一点的办法是新建一个,然后删掉原来那个。
 
$('<input type="text" name="username" />').appendTo(xxx.parent()); 
xxx.remove(); 


最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务