链接到文件

时间:2016-10-24 15:07:47

标签: javascript html

以下给定变量位于脚本内的函数中,位于html文件的正文中:

var popupContent = '<tr><td colspan="2">' + Autolinker.link(String(feature.properties['filepath'])) + '</td></tr>;

我试图更改它以链接到文件,并相应地更改它:

 var popupContent = '<tr><td colspan="2">'+ '<a href=' + Autolinker.link(String(feature.properties['filepath'])) + '>Check it out!</a>' + '</td></tr>';

问题是后者在它遇到的第一个空白区域上拆分文件路径。有没有办法重写这个变量,以便也包括空格?

输出链接的示例在第一种情况下为\\srv\Ex Ample\link\image.jpg,在第二种情况下为\\srv\Ex,方法是单击创建的链接。

0 个答案:

没有答案