我想说的是,如果URL以X结尾,那么我希望将div注入到网站上。但是,有多个X.
var adfc = '$0.00';
if (url.indexOf('YHOPT20T', 'YR20B', 'YR20T') > 0) { {
adfc = '$10.00';
}
if (adfc == '$0.00') {
if (shipsfree == true && returnsfree == true) {
document.write('<div style="padding-top:12px;"><span class="shipNote">FREE SHIPPING & FREE RETURN</span></div>');
sizeadviceshow = true;
}
else if (shipsfree == true && returnsfree == false) {
document.write('<div style="padding-top:12px;"><span class="shipNote">FREE SHIPPING</span></div>');
}
}
else {
document.write('<div style="padding-top:12px;"><span style="font-size:12px; font-weight:normal; color:#AA1E37; cursor:pointer; line-height:18px;">' + adfc + ' Additional Freight Charge</span></div>');
}
如何完成代码中多个部分的定位?