我有以下跟踪像素:
<img id="pixel" alt="" width="1" height="1" src="https://domain.com/file.cfm?amount={tag_amount}&tracking={tag_invoicenumber}&transtype=sale&merchantID=29562" />我需要在图像源的末尾添加一个变量。这是我正在玩的jQuery。
$('img#pixel [src]').append(affiliateCode);这不管用。有什么建议吗?提前感谢!
发布于 2010-11-18 04:24:22
你可以这样做:
var srcVal = $('img#pixel').attr('src');
$('img#pixel').attr('src', srcVal + affiliateCode);https://stackoverflow.com/questions/4208756
复制相似问题