Skip to content

Commit

Permalink
Merge pull request #73 from wangxiao/master
Browse files Browse the repository at this point in the history
Demo2 去掉对字符串的强转移和 Stringify。
  • Loading branch information
wangxiao committed Apr 16, 2015
2 parents aa7a43f + f19995a commit 8ecb9dc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions demo/demo2/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function main() {
if (data.msg.type) {
text = data.msg.text;
} else {
text = JSON.stringify(data.msg);
text = data.msg;
}
showLog(data.fromPeerId + ': ', text);
});
Expand Down Expand Up @@ -151,10 +151,10 @@ function encodeHTML(source) {
return String(source)
.replace(/&/g,'&')
.replace(/</g,'&lt;')
.replace(/>/g,'&gt;')
.replace(/\\/g,'&#92;')
.replace(/"/g,'&quot;')
.replace(/'/g,'&#39;');
.replace(/>/g,'&gt;');
// .replace(/\\/g,'&#92;')
// .replace(/"/g,'&quot;')
// .replace(/'/g,'&#39;');
}

function bindEvent(dom, eventName, fun) {
Expand Down

0 comments on commit 8ecb9dc

Please sign in to comment.