我有一个链接列表,所有链接都指向谷歌 map api.
链接中已经有daddr
(目的地)参数作为静态.我使用地理位置来查找用户的位置,我想在获得数据后将saddr
(源地址)添加到链接中.
so basically I will need to add something like &saddr=50.1234567,-50.03452
at the tail end of all the links pointing to google maps
所有链接都有一个名为directions-link
的类
and from this page I have figured out how to change them:
$("a.directions-link").attr("href", "http://www.google.com/");
However I only want to append my value to the end of the href without changing what the href already is.
How can I do that?