小编adi*_*ion的帖子

使用js获取与html源代码相关的选定html元素偏移量

我可以在html源代码中获取所选html元素的偏移量吗?

例如:

<html> <body> <a href="http://google.com">google</a> </body> <html>

如果用户选择谷歌文本,我希望得到40,因为这是从源头开始的偏移量.

我尝试使用Range对象,但找不到对此有用的东西.

谢谢!

javascript

5
推荐指数
1
解决办法
938
查看次数

无法连接到Windows应用商店中的localhost

当我在互联网上阅读时,microsoft阻止了监听和接收localhost(127.0.0.1)上任何端口流量的选项.我想开发用于在本地测试我的2个服务器/客户端应用程序.我按照这里的说明:http: //msdn.microsoft.com/en-us/library/windows/apps/hh780593.aspx

但它不起作用.当我使用调试选项时,我得到:

网络功能状态

InternetClient                Not Used and Insecure
InternetClientServer          Not Used and Insecure
PrivateNetworkClientServer    Not Used and Insecure
Run Code Online (Sandbox Code Playgroud)

详细的交通报告

InternetClient                Not Used and Insecure
Run Code Online (Sandbox Code Playgroud)
InternetClientServer          Not Used and Insecure
Run Code Online (Sandbox Code Playgroud)
PrivateNetworkClientServer    Not Used and Insecure
Run Code Online (Sandbox Code Playgroud)

知道为什么它不起作用吗?

loopback-address windows-store-apps

0
推荐指数
1
解决办法
4130
查看次数