开发者

Serialize a DOM range

开发者 https://www.devze.com 2022-12-20 02:58 出处:网络
is there any standard/easy way 开发者_高级运维to serialize a DOM Range (and the IE equivalent) with java script.

is there any standard/easy way 开发者_高级运维to serialize a DOM Range (and the IE equivalent) with java script.

The motivation is to store the current selection for a document together with its HTML code.


I thought of using XPath for it, but before I start to reinventing the wheel maybe there is something already working available and I just haven't found it (best would be a jQuery based solution).


I think I got the answer visit link below : Rangy, A cross-browser JavaScript range and selection library


There have been a few times I would have found something like this useful and I don't know of anything that currently exists. XPath seems the logical choice to me.

0

精彩评论

暂无评论...
验证码 换一张
取 消