我需要替换此URL
http:///prod/ap4s/appleproducts/iphone/4S
使用
http:///prods.aspx?prod_id=ap4s
从现有的url中获取productId "ap4s“,并将其作为查询字符串传递。
('a').each(function(){
$(this).attr('href') <--- Modify href here..
}我看不出替换在这里有多大帮助。因此,寻找一些更好的替代方案或一些建议,以朝着正确的方向前进…
发布于 2012-04-06 03:06:00
$('a').each(function(){
$(this).attr('href','http:///prods.aspx?prod_id='+$(this).attr('href').split('/')[3])
}https://stackoverflow.com/questions/10034151
复制相似问题