Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit 7ca74ee

Browse files
author
kris
committed
added encodeuricomponent. fixes #7
1 parent e73ebab commit 7ca74ee

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

dist/whatsapp-button.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/button.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ waShBtn.prototype.crBtn = function() {
8989
var t = b[i].getAttribute("data-text");
9090
var u = b[i].getAttribute("data-href");
9191
var o = b[i].getAttribute("href");
92-
var at = "?text=" + t;
92+
var at = "?text=" + encodeURIComponent( t );
9393
if (t) {
94-
at += " ";
94+
at += "%20";
9595
}
9696
if (u) {
97-
at += u;
97+
at += encodeURIComponent( u );
9898
} else {
99-
at += document.URL;
99+
at += encodeURIComponent( document.URL );
100100
}
101101
b[i].setAttribute("href", o + at);
102102
b[i].setAttribute("target", "_top");

0 commit comments

Comments
 (0)