Google地球API无法呈现包含" javascript"的href链接字

时间:2016-11-01 06:24:25

标签: google-maps google-maps-api-3 href kml google-earth-plugin

我正在向包含html表的Google地球API提供KML文件,以使用IE 11查看Google地球插件上的某些超链接。此表包含一些文本说明,这些说明实际上也是超链接。例如,请参阅以下KML文件部分:

<description><![CDATA[
  <table width="500px" bordercolor="black"> 
    <tr style="font-size:10px;color:#000000;font-family:Verdana;background-color:#d9e6ea;font-weight:bold;" bgcolor="#c9c9c9">
      <td style="word-break:break-all;">Description</td>
      <td style="word-break:break-all;">Time</td>
      <td style="word-break:break-all;">Location Of</td>
    </tr>
    <tr style="font-size:10px;color:#000000;font-family:Verdana;background-color:#d9e6ea;" bgcolor="#c9c9c9">
      <td style="word-break:break-all;white-space:normal;" width="45%">
        <a href="http://www.google.com">itsmysite</a>
      </td>
      <td style="word-break:break-all;white-space:normal;" width="20%">19/09/2016 19:34:05</td>
      <td style="word-break:break-all;white-space:normal;" width="30%"> [ Src ] </td>
    </tr>
  </table>
]]></description>

现在,正如您所看到的,上表将在Google Earth API上生成一个html表格,链接描述为&#34; itsmysite&#34;其超链接指向谷歌网站。 这很好用。我可以在API上看到描述(&#34; itsmysite&#34;)作为超链接,点击此链接就会把我带到google网站。

现在,当我提供“javascript&#39; href标签中的单词。例如,如果我用以上KML文件中的以下内容替换描述:

<a href="http://www.googlejavascript.com">itsmysite</a>

Google地球API不会将其渲染为超链接。我需要提供&#39; javascript&#39;我的网址中的参数如下:

<a href="example.com/home?param1=javascript&param2=123">itsmysite</a>

目前,Google地球API只是渲染表格(即使在href标签中提供了&#39; javascript&#39;),当我使用浏览器开发者工具导航到描述时,我看到整个href标记丢失了。

我不确定这是一个错误还是我没有正确地做到这一点。请建议。

感谢。

0 个答案:

没有答案