-1

我的 Javascript 数组内容如下所示

Order[0] = Order ID
Order[1] = Unused
Order[2] = Payment Amount

我想将以下参数 oid=Order[0] & amt=Order[2] 传递给以下

<img src="https://gan.doubleclick.net/gan_conversion?advid=K123456&oid=12345&amt=123.45" width=1 height=1>

我已经写了这段代码,但它不起作用

<script>    document.write('<img src="https://gan.doubleclick.net/gan_conversion?advid=K539002&oid=+%Order[0]%+&amt=+%Order[2]%" width=1 height=1>')</script>

不知道有什么问题

4

1 回答 1

1

您需要正确连接值:

<script>
    document.write('<img src="https://gan.doubleclick.net/gan_conversion?advid=K539002&oid=' + Order[0] + ' &amt=' + Order[2] + "' width="1" height="1" />')
</script>
于 2012-07-11T10:24:53.530 回答