Skip to content

Commit fdbe184

Browse files
committed
ignore
1 parent 0dfcc22 commit fdbe184

4 files changed

Lines changed: 28 additions & 1 deletion

File tree

‎JavaSript/BOM/javascript-bom-window.js‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,15 @@ javascript-
8787

8888
scrollTo(x,y);
8989
* scrollTo() 方法可把内容滚动到指定的坐标。
90+
9091

92+
btoa(v)
93+
* 把数据转换为base64编码,好像不支持中文
94+
* 对于中文可以先URI编码
95+
96+
atob(b)
97+
* 把base64编码转换为原始数据
98+
9199
--------------------------
92100
javascript-事件 |
93101
--------------------------
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//����flag,�Ժ�ѧ

‎JavaSript/javascript-indexedDB.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//����flag,�Ժ�ѧ

‎JavaSript/javascript-源码.js‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,21 @@ doucment-
119119
cookie[name] = value;
120120
}
121121
return cookie;
122-
}
122+
}
123+
124+
----------------------------------------
125+
监听文字复制事件,并且添加自己的数据 |
126+
----------------------------------------
127+
document.addEventListener('copy', function (event) {
128+
var clipboardData = event.clipboardData || window.clipboardData;
129+
if (!clipboardData) {
130+
return;
131+
}
132+
//复制到的文字信息
133+
var text = window.getSelection().toString();
134+
if (text) {
135+
event.preventDefault();
136+
//修改原来的文字信息
137+
clipboardData.setData('text/plain', text + '\n\njavaweb开发者社区版权所有');
138+
}
139+
});

0 commit comments

Comments
 (0)