【发布时间】:2015-06-25 01:22:07
【问题描述】:
我有这个
<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
【问题讨论】:
-
你解决过这个问题吗?
-
没有。 Plaid 计划在接下来的几周内发布几个更新,包括设置脚本的更好方法。在等待其中一些时,我已将其放在一边。
标签: cordova meteor ionic meteoric