我想在返回阶段使用此脚本,该脚本来自https://www.omise.co/card-js-api
<modelNormalBodyPartResult: modelNormalBodyPartResult object> needs to have a value for field "modelnormalbodypartresult" before this many-to-many relationship can be used.
但它似乎根本不起作用
答案 0 :(得分:0)
必须在</script>
和<script type="text/javascript" src="https://cdn.omise.co/card.js"
data-key="YOUR_PUBLIC_KEY"
data-image="PATH_TO_LOGO_IMAGE"
data-frame-label="Merchant site name"
data-button-label="Pay now"
data-submit-label="Submit"
data-location="yes"
data-amount="10025"
data-currency="thb"
>
</script>
标记之间插入Javascript。
{{1}}&#13;
就我而言,自闭标签不适用。
这应该为您提供一个很好的参考 - Why don't self-closing script tags work?
答案 1 :(得分:0)
将模板字符串与React
一起使用var script = `<script type="text/javascript" src="https://cdn.omise.co/card.js"
data-key="YOUR_PUBLIC_KEY"
data-image="PATH_TO_LOGO_IMAGE"
data-frame-label="Merchant site name"
data-button-label="Pay now"
data-submit-label="Submit"
data-location="yes"
data-amount="10025"
data-currency="thb"></script>`;
document.body.appendChild(script);