我有这个
<script
src="https://cdn.plaid.com/connect/stable/connect-initialize.js"
data-client-name="Client Name"
data-form-id="plaidForm"
data-key="public_key"
data-product="auth"
data-env="tartan"
data-webhook="/webhook"
/>
如何在一个 Meteor 模板中将其转换为可工作的跨浏览器脚本?
我通过在 template.js 渲染函数中像这样加载它来让它在 Chrome 中工作,但是当我使用 Ionic 时它不能正确加载到移动设备上。我不知道为什么,但我试图先找到最简单的答案(也许 Ionic 无法识别我的 javascript 代码)......
任何帮助表示赞赏。
$(document).ready(function() {
var script = document.createElement('script');
script.async = "async";
script.src = "https://cdn.plaid.com/connect/stable/connect-initialize.js";
script.setAttribute("data-client-name", "Client Name");
script.setAttribute("data-form-id", "plaidForm");
script.setAttribute("data-key", Meteor.settings.public.plaid.public_key);
script.setAttribute("data-product", "auth");
script.setAttribute("data-env", "tartan");
script.setAttribute("data-webhook", "https://e39f6d752a20d470.a.passageway.io/hookthe/plaid");
$("head").append(script);
});
这是我在 Android 模拟器上运行的浏览器检查的结果。
Failed to load resource: the server responded with a status of 404 (Not Found)
https://cdn.plaid.com/connect/stable/connect-initialize.js?_=1429320699573