0

我真的希望你们中的任何人都能够帮助我,因为我已经在这几个小时没有运气了。

我正在使用 mapbox.com api 生成地图,但我似乎无法为其添加链接!

所以,例如,如果我这样做:

properties: {
    title: 'Tooltip Title',
    description: '<a target="_blank" href="#modal"data-toggle="modal">Test</a>',
    'marker-size': 'large',
    'marker-color': '#35B070',
}

它将回显描述为

<a>Test</a>

但如果我举个例子

properties: {
    title: 'Tooltip Title',
    description: '<a target="_blank" href="http://www.google.com/" data-toggle="modal">Test</a>',
    'marker-size': 'large',
    'marker-color': '#35B070',
}

它将回显为:

<a target="_blank" href="http://www.google.com/">Test</a>

有谁知道如何管理这个?......让我疯了......

4

1 回答 1

1

请参阅markerLayer的sanitizer 选项。默认情况下,对通过 markers/mapbox.js 的 HTML 进行清理以防止人们编写href="javascript:evilXSSAttack()".

于 2013-11-01T19:45:29.473 回答