He元素

Don't be shy just try!

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2016年2月14日

摘要: 下载地址:https://github.com/samacs/simple_html_dom 一直以来使用php解析html文档树都是一个难题。Simple HTML DOM parser 帮我们很好地解决了这个问题。可以通过这个php类来解析html文档,对其中的html元素进行操作 (PHP5+ 阅读全文
posted @ 2016-02-14 16:35 He元素 阅读(7401) 评论(0) 推荐(0) 编辑

摘要: jQuery自定义类封装: (function ($) { $.DragField = function (arg) { var name = "你好"; //这个是私有变量,外部无法访问 this.testFun = function () { //this.testFun方法,加上了this,就 阅读全文
posted @ 2016-02-14 14:57 He元素 阅读(364) 评论(0) 推荐(0) 编辑

摘要: 扩展Array的原型对象的方法 // 删除数组中数据 Array.prototype.del = function(n) { if (n<0) return this; return this.slice(0,n).concat(this.slice(n+1,this.length)); } // 阅读全文
posted @ 2016-02-14 13:14 He元素 阅读(311) 评论(0) 推荐(0) 编辑

摘要: JS 字符串有replace() 方法。但这个方法只会对匹配到的第一个字串替换。 如下例: var str = "wordwordwordword"; var strNew = str.replace("word","Excel"); alert(strNew); 如果要全部替换的话,JS 没有提供 阅读全文
posted @ 2016-02-14 13:03 He元素 阅读(747) 评论(0) 推荐(0) 编辑