Javascript 我自己的“分享”插件
我想做一些类似Twitter的插件。我的意思是最简单的一个“推特这个”Javascript 我自己的“分享”插件,javascript,html,Javascript,Html,我想做一些类似Twitter的插件。我的意思是最简单的一个“推特这个” 这是一个用于粘贴的代码,但我现在不知道如何获取当前网站的url。也许是javascript,但如何?您可以修改我的代码吗?您可以从window.location.href获取当前页面的url: textarea onclick="this.focus(); this.select();" rows="1" cols="100" readonly="readonly" style="background: #ffffcc; f
这是一个用于粘贴的代码,但我现在不知道如何获取当前网站的url。也许是javascript,但如何?您可以修改我的代码吗?您可以从window.location.href获取当前页面的url: textarea onclick="this.focus(); this.select();" rows="1" cols="100" readonly="readonly" style="background: #ffffcc; font-family: Monospace;"> a href="http://127.0.0.1:8000/ajax/share?url=......" onclick="window.open(this.url, 'blabla', 'width=600,height=400');"> /textarea>
<button onclick="window.open('http://myUrl?from='+window.location.href)">
Click!
</button>