我正在尝试与Cordova应用程序集成。 它在移动浏览器上运行良好,但在Cordova应用程序内部无法正常工作
获取file://go.referralcandy.com/purchase/sjnnafnpwv64gygz1p2al6bol.js?lightb... File not found
它在URL中添加前缀file
。
有一些动态变量。脚本只有在具有值时才会执行。
以下代码来自referalCandy网站。
代码
<script ng-if="fname && lname && email && amount && currency && timestamp && externalReferenceId && signature">
(function(e) {
var t, n, r, i, s, o, u, a, f, l, c, h, p, d, v;
z = "script";
l = "refcandy-purchase-js";
c = "refcandy-popsicle";
p = "go.referralcandy.com/purchase/";
t = "data-app-id";
r = {
email: "a",
fname: "b",
lname: "c",
amount: "d",
currency: "e",
"accepts-marketing": "f",
timestamp: "g",
"referral-code": "h",
locale: "i",
"external-reference-id": "k",
signature: "ab"
};
i = e.getElementsByTagName(z)[0];
s = function(e, t) {
if (t) {
return "" + e + "=" + encodeURIComponent(t)
} else {
return ""
}
};
d = function(e) {
return "" + p + h.getAttribute(t) + ".js?lightbox=1&aa=75&"
};
if (!e.getElementById(l)) {
h = e.getElementById(c);
if (h) {
o = e.createElement(z);
o.id = l;
a = function() {
var e;
e = [];
for (n in r) {
u = r[n];
v = h.getAttribute("data-" + n);
e.push(s(u, v))
}
return e
}();
o.src = "" + e.location.protocol + "//" + d(h.getAttribute(t)) + a.join("&");
return i.parentNode.insertBefore(o, i)
}
}
})(document);