$('.storeUrl a').each(function(){
var Ahref = $(this).attr('href');
Ahref = Ahref + "?longitude="+longitude + "&latitude=" + latitude;
$(this).attr("href",Ahref);
});
li标签添加class="storeUrl",用each遍历li标签下的a;
定义Ahref为获取到的a标签href地址;
给href添加经纬度参数;
把Ahref赋值给a标签的href。

本文介绍使用jQuery遍历li标签下的a元素,并动态给每个a标签的href属性添加经度和纬度参数的方法。
1104

被折叠的 条评论
为什么被折叠?



