如何更改Google徽标的href [英] How to change Google logo's href
本文介绍了如何更改Google徽标的href的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想更改点击以在Google地图上查看此区域链接,但我无法选择正确的 a
标记。
感谢您可以利用 stackoverflow.com/a/17330086/2423859\">罗伯的答案
var anchors = document.getElementsByTagName('a '),
l = anchors.length,
i,
a; (i = 0; i <1; i ++){
a = anchors [i];
。
if(a.href.indexOf('maps.google.com/maps?')!== -1){
//在这里您可以操纵锚点
a.title = '';
a.onclick = function(){return false; };
注
请记住,它违反了Google Maps API ToS以删除Google品牌或ToS链接。
I would like to change the "Click to see this area on Google Maps" link, but I can't select the proper a
tag.
Thanks
解决方案
You can take advantage of RobH's answer
var anchors = document.getElementsByTagName('a'),
l = anchors.length,
i,
a;
for (i = 0; i < l; i++) {
a = anchors[i];
if (a.href.indexOf('maps.google.com/maps?') !== -1) {
// here you can manipulate the anchor
a.title = '';
a.onclick = function () { return false; };
}
}
NOTE
Remember It's against the Google Maps API ToS to remove the Google branding or the ToS link.
这篇关于如何更改Google徽标的href的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文