我正在尝试编辑以下代码以便放置在我的WordPress网站上,但我似乎无法弄清楚如何:
我更愿意这样做(1)但如果不可能我想展示三个小部件。
以下是来自http://www.goodrx.com/developer/widget的脚本:
<div id="goodrx_compare-price_widget"> </div>
<script>
var _grxdn = "axelex";
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src="//s3.amazonaws.com/assets.goodrx.com/static/widgets/compare.min.js";
s.parentNode.insertBefore(g,s)}(document,"script"));
</script>
答案 0 :(得分:0)
我不认为您可以将多种药物添加到同一个小部件,因为API格式每个小部件仅支持一种药物。但是,您可以显示三个不同的小部件:
<script>
var _grxdn = "drug_name_1";
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src="//s3.amazonaws.com/assets.goodrx.com/static/widgets/compare.min.js";
s.parentNode.insertBefore(g,s)}(document,"script"));
</script>
var _grxdn = "drug_name_2";
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src="//s3.amazonaws.com/assets.goodrx.com/static/widgets/compare.min.js";
s.parentNode.insertBefore(g,s)}(document,"script"));
</script>
var _grxdn = "drug_name_3";
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src="//s3.amazonaws.com/assets.goodrx.com/static/widgets/compare.min.js";
s.parentNode.insertBefore(g,s)}(document,"script"));
</script>
小部件的格式应如下所示:
URL Parameters
api_key
Required
name
Required if ndc excluded
Expected Data Type: String
Example: “lipitor”
更多: