<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[杨传龙的专栏]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/yang_chuanlong</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; yang_chuanlong]]></copyright><item><title><![CDATA[正则表达式非捕获分组与具名分组]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/80271753</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/80271753</guid><author>yang_chuanlong</author><pubDate>Thu, 10 May 2018 18:50:51 +0800</pubDate><description><![CDATA[1， 非捕获分组在使用正则表达式的时候，我们的表达式中可能有多个分组，而我们真正关心的只有其中的某一个分组，那么如何让我们的表达式不去捕获我们不关心的分组呢，比如我们有表达式const regex = /(Jane|John|Alison)\s(.*?)\s(Smith|Smuth)/;这个表达式匹配英语中的最常见的几个英文名，包括名字，中间名和姓，使用该表达式来匹配下面的名字const resu...]]></description><category></category></item><item><title><![CDATA[openlayer4加载百度地图]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/79933378</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/79933378</guid><author>yang_chuanlong</author><pubDate>Fri, 13 Apr 2018 19:11:46 +0800</pubDate><description><![CDATA[var resolutions = [];
for(var i=0; i&amp;lt;= 18; i++) {
    resolutions[i] = Math.pow(2, 18 - i);
}

var tileGrid = new ol.tilegrid.TileGrid({
    origin:[0, 0],
    resolutions: resolutions
});

var bai...]]></description><category></category></item><item><title><![CDATA[dojo源码阅读之dojo/Stateful]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/79914703</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/79914703</guid><author>yang_chuanlong</author><pubDate>Thu, 12 Apr 2018 16:18:20 +0800</pubDate><description><![CDATA[dojo/Stateful是dojo中的一个基类，提供了能够观测对象属性变化的功能，Stateful 使用文档。其基本用法如下：var s = new Stateful({foo:8})
s._fooSetter = function(value){
  this.foo = value;
};
s.watch(&quot;foo&quot;, function(name, oldValue, newValue){
...]]></description><category></category></item><item><title><![CDATA[dojo源码阅读之declare]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/79835138</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/79835138</guid><author>yang_chuanlong</author><pubDate>Sat, 07 Apr 2018 00:02:21 +0800</pubDate><description><![CDATA[dojo是一个开源的javascript 类库，它提供了一个declare函数来方便的实现多重继承。下面看下declare的实现原理。1， 使用declare声明一个类（未继承其他类的类）。let Human = declare([], {
    name: &quot;&quot;,
    constructor:function(args){
        for(let i in args) {
    ...]]></description><category></category></item><item><title><![CDATA[使用javascript下载页面中的表格数据]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/78088274</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/78088274</guid><author>yang_chuanlong</author><pubDate>Mon, 25 Sep 2017 18:49:50 +0800</pubDate><description><![CDATA[以前要下载web页面中的数据要依靠sever端，现在使用Blob等较新技术可以直接使用javascript把页面表格中的数据下载下来，本篇主要讲述把表格数据下载为csv文件。



例如我们想要把上面表格中的数据下载为csv文件，步骤如下


获取表格中文本内容。拼接成csv格式的字符串。如本例中最终拼接后的字符串应为: Name;Math;Physics;Chemistry; \n Melani...]]></description><category></category></item><item><title><![CDATA[使用XPath选择DOM元素]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/77751878</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/77751878</guid><author>yang_chuanlong</author><pubDate>Thu, 31 Aug 2017 19:26:05 +0800</pubDate><description><![CDATA[在自动化UI测试中, 我们需要找到页面中某个元素进行操作，如单击表单中的某个按钮。我们可以使用测试工具来选择我们想要操作的元素（如intern提供了如 remote.findByCssSelector, remote.findById等等），其中一个方法为remote.findByXpath. 我们可以根据Xpath来选择我们想要定位的元素。 
 为了确定所使用的Xpath是否正确，我们可以在浏览器]]></description><category></category></item><item><title><![CDATA[javascript中的原型继承]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/77685182</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/77685182</guid><author>yang_chuanlong</author><pubDate>Tue, 29 Aug 2017 19:14:50 +0800</pubDate><description><![CDATA[1， 什么是原型？ 
在javascript中当我们定义一个函数时，浏览器会为我们定义的函数添加一个prototye属性，这个prototye属性指向一个对象，这个被prototype指向的对象即为我们定义函数的原型。例如 
 
    function Person(){ 
    }]]></description><category></category></item><item><title><![CDATA[javascript 复制内容到剪切板]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/76936591</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/76936591</guid><author>yang_chuanlong</author><pubDate>Tue, 08 Aug 2017 20:14:27 +0800</pubDate><description><![CDATA[在github里面，我们经常使用的一个功能就是复制代码仓库地址。 下面介绍实现这种功能的一种方法。
步骤：
1， 创建一个临时的input
2， 设置临时input的value为要复制的内容
3，执行 document.execCommond('copy');
4， 删除临时input


示例： https://jsfiddle.net/5g9map9c/]]></description><category></category></item><item><title><![CDATA[vim使用总结]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/73610270</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/73610270</guid><author>yang_chuanlong</author><pubDate>Thu, 22 Jun 2017 18:59:27 +0800</pubDate><description><![CDATA[搜索，命令行模式输入冒号和反斜杠后，再输入要搜索的内容，按n向后搜索，按N向前搜索。]]></description><category></category></item><item><title><![CDATA[clientWidth offsetWidth scrollWidth区别]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/52893704</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/52893704</guid><author>yang_chuanlong</author><pubDate>Sat, 22 Oct 2016 18:37:30 +0800</pubDate><description><![CDATA[clientWidth: 元素内部宽度，即可视内容区域宽度， 它包括左侧padding宽度加上可视内容再加上右侧padding宽度。也即元素左边界内侧到右边界内侧的距离。
offsetWidth:元素外部宽度，即整个元素的宽度，包括左右边界宽度加上左右padding宽度再加上可视内容区域宽度
scrollWidth: 元素内部整个内容区域的宽度。在元素没有滚动条的情况, scrollWidth]]></description><category></category></item><item><title><![CDATA[mongodb格式化输出查询结果]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/50185759</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/50185759</guid><author>yang_chuanlong</author><pubDate>Sat, 05 Dec 2015 14:26:23 +0800</pubDate><description><![CDATA[在.mongorc.js文件中添加如下配置： DBQuery.prototype._prettyShell = true]]></description><category></category></item><item><title><![CDATA[get currrent script url]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/49307951</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/49307951</guid><author>yang_chuanlong</author><pubDate>Wed, 21 Oct 2015 18:26:56 +0800</pubDate><description><![CDATA[function getCurrentScriptUrl(){
    if(document.currentScript){
        return document.currentScript.src;  //chrome firefox  opera 32
    }else{
        try{
            throw Error();
        }catch]]></description><category></category></item><item><title><![CDATA[javascript 中 x offsetX clientX screenX pageX的区别]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/49232945</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/49232945</guid><author>yang_chuanlong</author><pubDate>Sun, 18 Oct 2015 23:52:37 +0800</pubDate><description><![CDATA[在javascript的事件对象中的关于事件鼠标位置的几个属性（x, pageX, offsetX, scrrenX clientX)及（y, pageY, offsetY, screenY, clientY),
其中offsetX, offsetY是指相对于触发事件元素的左上角的偏移。但在不同的浏览器中其值又有所不同。在chrome opera, safari中是指外边缘，即把该元素边框的宽度]]></description><category></category></item><item><title><![CDATA[把周数转化为日期]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/46967931</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/46967931</guid><author>yang_chuanlong</author><pubDate>Mon, 20 Jul 2015 14:34:06 +0800</pubDate><description><![CDATA[function convertWeekNumberToFirstDate(sYear, sWeek, startFromFirstMonday)
{
    if (startFromFirstMonday == undefined) startFromFirstMonday = true;

    var weekIndex = 1;

    var year = parseInt(sYe]]></description><category></category></item><item><title><![CDATA[使用sugar crm rest api 创建联系人时有概率返回被删除的联系人的id]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/45030301</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/45030301</guid><author>yang_chuanlong</author><pubDate>Mon, 13 Apr 2015 19:20:05 +0800</pubDate><description><![CDATA[最近项目有一个需求，要把我们的数据导出到sugar crm中，第一次导出一条记录时到sugar crm的联系人中，sugar crm 会自动生成一个id（记为contact_id1）, 在sugar crm 中把该导出的联系人删除，再把数据再一次导出到sugar crm中，sugar crm会生成一个contact_id2, 令人困惑的是contact_id2会有概率性等于contact_id1，]]></description><category></category></item><item><title><![CDATA[js clientTop]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/44346513</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/44346513</guid><author>yang_chuanlong</author><pubDate>Tue, 17 Mar 2015 19:32:30 +0800</pubDate><description><![CDATA[今天要做页面中元素的滚动，发现一个知识点，clientTop就是设置元素的border-top的值。类型number,(int)]]></description><category></category></item><item><title><![CDATA[js closure js 闭包的应用]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/41088725</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/41088725</guid><author>yang_chuanlong</author><pubDate>Thu, 13 Nov 2014 21:33:22 +0800</pubDate><description><![CDATA[var arr = new Array(123, 456, 789);
for(i=0; i
var key = arr[i];
$('' + key + '').prependTo($('#test')).bind('click', function(k){
return function(){
alert(k)
}
}(key));

}]]></description><category></category></item><item><title><![CDATA[jquery remove 一个元素再append或prepend到其它的元素后，则其通过bind添加的事件则被删除]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/38928897</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/38928897</guid><author>yang_chuanlong</author><pubDate>Fri, 29 Aug 2014 18:02:07 +0800</pubDate><description><![CDATA[页面zhon

 first
 second  
 third]]></description><category></category></item><item><title><![CDATA[ie浏览器中用js获取navigator.cookieEnabled总为true]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/38021695</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/38021695</guid><author>yang_chuanlong</author><pubDate>Mon, 21 Jul 2014 18:22:11 +0800</pubDate><description><![CDATA[最近因为项目上的需要须判断用户是否禁用了js和]]></description><category></category></item><item><title><![CDATA[firefox前台打不开，但后台在运行]]></title><link>https://blog.youkuaiyun.com/yang_chuanlong/article/details/36175181</link><guid>https://blog.youkuaiyun.com/yang_chuanlong/article/details/36175181</guid><author>yang_chuanlong</author><pubDate>Tue, 01 Jul 2014 09:44:46 +0800</pubDate><description><![CDATA[运行 firefox.exe -p -no-remote 命令，弹出如下窗口：


点击创建配置文件：


点击‘完成’：


点击‘启动firefox’即可。]]></description><category></category></item></channel></rss>