摘要: jQuery读取JSF中标签、属性的方法代码示例: 如果您点击我,我会消失。 1.使用class来获取如代码所示,可以及直接通过jQuery(".wo").addClass('hidden');来获取。2.使用input[id]获取 jQuery("input[id*='wo']").addClass('hidden'); 3.通过使用input[type]获取 jQuery( 'input[type=subm... 阅读全文
posted @ 2013-08-30 10:11 bupt_ding 阅读(372) 评论(0) 推荐(0)
摘要: 推荐一个很好的博客http://jackliew.blog.163.com/blog/static/2866998201182832557475/ 阅读全文
posted @ 2013-08-29 09:11 bupt_ding 阅读(176) 评论(0) 推荐(0)
摘要: 如何在jsf中使用CSS设置背景图片1.首先在中添加CSS文件的引用: 2.然后编辑css文件:body { background-image: url(/guessnumber-jsf/resources/css/background.jpg); font-size: 12px; font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; color: 阅读全文
posted @ 2013-08-28 23:05 bupt_ding 阅读(624) 评论(0) 推荐(0)
摘要: 1.对象冒充function ClassA(sColor) { this.color = sColor; this.sayColor = function () { alert(this.color); };}function ClassB(sColor) {}function ClassB(sColor) { this.newMethod = ClassA; this.newMethod(sColor); delete this.newMethod;}function ClassB(sColor, sName) { this.newMe... 阅读全文
posted @ 2013-08-20 17:12 bupt_ding 阅读(132) 评论(0) 推荐(0)
摘要: 1.重命名已有方法Array.prototype.enqueue = function(vItem) { this.push(vItem);};Array.prototype.dequeue = function() { return this.shift();};2.添加方法Array.prototype.indexOf = function (vItem) { for (var i=0; i<this.length; i++) { if (vItem == this[i]) { return i; } } return -1;}3.为本地对象添加新方法如果想... 阅读全文
posted @ 2013-08-20 11:18 bupt_ding 阅读(511) 评论(0) 推荐(0)
摘要: 推荐一个我最常用的方式(来自http://www.w3school.com.cn/js/pro_js_object_defining.asp)。function Car(sColor,iDoors,iMpg) { this.color = sColor; this.doors = iDoors; this.mpg = iMpg; this.drivers = new Array("Mike","John");}Car.prototype.showColor = function() { alert(this.color);};var oCar1 = ne 阅读全文
posted @ 2013-08-19 10:52 bupt_ding 阅读(111) 评论(0) 推荐(0)