我尝试制作附加组件以发送我打开的网站的网址
function xxxx()
{
a = "mailto:xxx@xxxx.com?subject= xxxxxxxxxxxxxxxxxx" + document.title;
a += "&body=" + escape("url" + window.location.href);
window.location.href = a;
}
但出现的是
“chrome:/ / browser / content / browser.xul”<<叠加在chrome.manifest
有任何解决方案或任何其他方法来解决这个问题吗?
答案 0 :(得分:1)
答案 1 :(得分:0)
对于大多数浏览器:
document.URL
对于某些版本,如果FF:
window.location.href
答案 2 :(得分:0)
在jquery中使用它
$(location).attr('href');
或Javascript
alert(window.location);
希望这会有所帮助
答案 3 :(得分:0)
以下是使用Javascript和JQuery检索URL路径的一些方法
//jquery
$(location).attr('href');
//pure javascript
var pathname = window.location.pathname;
有关详细信息,请参阅此博文:http://www.jquery4u.com/snippets/jquery-current-page-url/
谢谢,
Rahul Patil