标签:on() res business 产品 img each cabinet ted who
主要是通过js将地址的前缀改为医疗国家的网址,然后通过each循环更改每个网址
具体代码如下:
var o=$(".pro_listbox").find(".pro_listbox");
o.each(function(){
var tmp=$(this).find("img").attr("src").split("/");
var h=$(this).find("a").attr("href").split("/");
var m=tmp[tmp.length-3];
if(m=="preservation"){
$(this).find("a").attr("href","/ph/business_products/medical/preservation/"+h[h.length-1].replace("html","shtml"));
}else if(m=="who_pqs_certificated_equipment"){
$(this).find("a").attr("href","/ph/business_products/medical/who_pqs_certificated_equipment/"+h[h.length-1].replace("html","shtml"));
}else if(m=="bio_safety_cabinet"){
$(this).find("a").attr("href","/ph/business_products/medical/bio_safety_cabinet/"+h[h.length-1].replace("html","shtml"));
}
});
海外医疗产品地址转换
标签:on() res business 产品 img each cabinet ted who
原文地址:http://www.cnblogs.com/circleone/p/7131129.html