CN102637193B - Webpage instant collaborative browsing method based on DOM (document object model) and XMPP (extensible messaging and presence protocol) - Google Patents
Webpage instant collaborative browsing method based on DOM (document object model) and XMPP (extensible messaging and presence protocol) Download PDFInfo
- Publication number
- CN102637193B CN102637193B CN201210044653.0A CN201210044653A CN102637193B CN 102637193 B CN102637193 B CN 102637193B CN 201210044653 A CN201210044653 A CN 201210044653A CN 102637193 B CN102637193 B CN 102637193B
- Authority
- CN
- China
- Prior art keywords
- node
- information
- text
- dom
- webpage
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 21
- 230000005540 biological transmission Effects 0.000 claims abstract description 3
- 238000012546 transfer Methods 0.000 claims description 8
- 238000004891 communication Methods 0.000 claims description 6
- 230000008859 change Effects 0.000 claims description 4
- 230000005587 bubbling Effects 0.000 claims description 2
- 238000003780 insertion Methods 0.000 claims description 2
- 230000037431 insertion Effects 0.000 claims description 2
- 238000013517 stratification Methods 0.000 claims description 2
- 230000001960 triggered effect Effects 0.000 claims description 2
- 230000003993 interaction Effects 0.000 abstract description 3
- 239000000284 extract Substances 0.000 abstract 1
- 238000005516 engineering process Methods 0.000 description 5
- 238000004458 analytical method Methods 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 235000001674 Agaricus brunnescens Nutrition 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
Abstract
The invention discloses a webpage instant collaborative browsing method based on a DOM (document object model) and an XMPP (extensible messaging and presence protocol). In the method, by organically combining the instant messaging and a collaborative browsing mode, the collaborative browsing information is transmitted in an instant messaging mode, a user can quickly realize instant collaborative browsing of webpage with another user while browsing the webpage, a dialogue box can be opened in any position of the webpage, and the webpage can be marked at will. In terms of collaborative browsing, the method extracts the collaboration information based on the DOM, has small information transmission quantity, is widely supported by the mainstream browsers and can adapt to different display terminals of the user to ensure the accuracy of the collaboration information; and in terms of instant messaging, the method transmits information based on an XMPP mode, wherein the XMPP is an open-source messaging protocol widely adopted by the Internet companies and can realize seamless interaction with the mainstream instant messaging networks of GTalk (Google Talk) and MSN (Microsoft service Network).
Description
Technical field
The present invention relates to a kind of instant collaborative browse technology of obtaining, transmitting and reduce that can realize webpage label content and chat message.Relate in particular to a kind of instant collaborative browse method of webpage based on DOM (DOM Document Object Model Document Object Model) and XMPP (can expand communication and presentation protocol The Extensible Messaging and Presence Protocol).
Background technology
Along with the high speed development of Internet technology, internet has become an indispensable part in people's life gradually.Various internet, applications also occur like the mushrooms after rain.Internet by people contact together, is that online amusement or Web conference etc. all need to provide the comment interaction capabilities to internet public information often.This interaction capabilities is mainly to realize by instant messaging and collaborative browse mode at present.
These two kinds of modes respectively have relative merits.Instant messaging be take and transmitted text and pictorial information as main, on exchanging internet, needs user to copy the operations such as stickup during existing information, and property easy to use is poor.The operations such as collaborative browse mode can directly mark on existing document, but current collaborative browse mainly works in " Publish-subscribe " mode, and real-time is poor, is difficult to realize instant interchange.
Summary of the invention
The object of the invention is to: the present invention is by instant messaging and the organic combination of collaborative browse mode.Collaborative browse information is transmitted in instant messaging mode, can be made user in browsing page, realize rapidly the instant collaborative browse of webpage with another user.Can realize the frame of opening a dialogue in webpage optional position, and the page is marked arbitrarily.
On collaborative browse, this technology is extracted cooperative information based on HTMLDOM (hypertext markup language document object model Hypertext Markup Language Document Object Model), transinformation is little, by each main flow browser, extensively supported, and can adapt to the display terminal that user is different, guarantee the accuracy of cooperative information.
In instant messaging, this technology adopts carries out communication based on XMPP protocol mode.The communications protocol of increasing income that XMPP Shi Beige Internet firm extensively adopts, can with GTalk, the main flow instant messaging network of MSN carries out seamless mutual.
The technical scheme that the present invention adopts is in order to achieve the above object: a kind of instant collaborative browse method of webpage based on DOM and XMPP, is characterized in that: the method comprises the following steps:
Obtaining of step (1), collaborative browse information;
Obtaining of wherein said step (1) collaborative browse information comprises with constructing further:
Step (a1), nodal information obtain;
Step (a2), text node interior location acquisition of information;
Step (a3), non-text node interior location acquisition of information;
Step (a4), markup information obtain.
The realization of step (2), instant messaging;
The realization of wherein said step (2) instant messaging further comprises:
The structure of step (b1), message transfer;
The parsing of step (b2), message transfer is with compatible.
The parsing of step (3), collaborative browse information.
The parsing of wherein said step (3) collaborative browse information further comprises:
Step (c1), node location information are resolved;
Step (c2), intra-node positional information are resolved;
Step (c3), markup information are resolved.
Advantage of the present invention is:
The present invention is by instant messaging and the organic combination of collaborative browse mode.Collaborative browse information is transmitted in instant messaging mode, realized and having complementary advantages.Can make user conveniently realize sharing, exchanging of webpage with another user in browsing page.
Accompanying drawing explanation
Fig. 1 is simple HTML dom tree.
Fig. 2 is typical collaborative browse process once.
Embodiment:
Introduce specific embodiments of the invention below.
The instant collaborative browse method of a kind of webpage based on DOM and XMPP of the present invention is implemented as follows:
Obtaining of 1 collaborative browse information
A1. nodal information obtains
DOM is the API (application programming interfaces) for HTML and XML document.DOM has described the node tree of a stratification, allows developer to add, remove and revise certain part of the page.And can obtain the access to node.As shown in figure mono-.
When user clicks a certain position on webpage, can be on this node trigger (onclick) event of click, and along dom tree always upwards on path each node trigger successively, until bubbling is to document (Document) node.When triggering onclick event under we stipulate particular case, to pile stack mode by the node storage triggering successively.Because the visible node on the page is all the child node of <body> node, can generate thus the unique path to Event triggered node by <body>.
A2. text node interior location acquisition of information
For the text node on the page (TEXT_NODE that <p><aGreatT.Grea T.GT etc. includes), need to find out the particular location that user clicks in text.The method document.createRangeFromPoint () that can be provided by 2 grades of DOM that obtains of position realizes.
A scope (range) is founded in the position that the method is clicked the mouse user.After obtaining this range, change respectively its front and back side-play amount and check in range whether can comprise effective word.If so, return to range with respect to the initial offset of text node, as the positional information of text node inside.
A3. non-text node interior location acquisition of information
For the non-text node on the page (<img><inputGreat T.GreaT.GT etc.), need to determine that user click event is with respect to the offset information of this element, the event attribute that can be provided by DOM: event X skew (event.offsetX) and event Y skew (event.offsetY) obtain.
A4. markup information obtains
When user marks on webpage, in the page, insert mark layer.According to different situations, mark layer position obtained by one of above two kinds of methods, or directly obtain mark layer with respect to the side-play amount of full page.
The realization of 2 instant messagings
B1. the structure of message transfer
The content of message is that the <message> node by defining in XMPP agreement transmits.Except <body> node is transferring text, can in <message> node, add more child node to reach the functions such as positional information of transmitting collaborative browse.Can insertion position information node, transmit collaborative browse positional information.For JavaScript object transfer, JavaScript object can be converted to json object, a character string is transmitted.
B2. the parsing of message transfer is with compatible
Adopting the process contrary with message constructing, is text message by the information analysis in <body> node, by the information analysis in positional information, is routing information.
Owing to adopting XMPP communications protocol, can directly use existing XMPP account (no matter it belongs to is for which service provider) to login, can fast the social circle of oneself be dissolved into native system.
For the instant messaging network that adopts XMPP agreement, when resolving the XML file of XMPP transmission, only can resolve the part of this network support.If by this project and common user communications such as GTalk, other child nodes in <message> node except <body> node can be ignored automatically, and message deteriorates to a common text message.Need not change system can realize the compatibility with each main flow instant communicating system.
The parsing of 3 collaborative browse information
C1. node location information is resolved
After user receives collaborative browse information, first according to the routing information of node, from <body> node, the page, find rapidly the node identical with the other side, utilize skew (offset) property calculation of each node layer to go out this node with respect to the side-play amount of the page.
C2. intra-node positional information is resolved
According to the difference of node type, computing node internal blas amount.
For non-text node, directly resolve X skew (offset) and Y skew (offset) attribute.
For the inside of calculating text node during with respect to the position of father node, need to be according to side-play amount before and after the text node obtaining in text node, in relevant position, insert a blank <span> node, attribute by <span> node obtains it for the position of father node, then delete <span>, recover the original structure of text node.
C3. markup information is resolved
While resolving the mark layer information that the other side sends, insert mark layer in the page, resolve according to above method the position of mark layer.
The part that the present invention does not elaborate belongs to techniques well known.
Claims (1)
1. the instant collaborative browse method of the webpage based on DOM and XMPP, is characterized in that: the method comprises the following steps:
Obtaining of step (1), collaborative browse information, specific as follows:
Step (a1), nodal information obtain; Wherein:
DOM is the application programming interfaces (API) for HTML and XML document, and DOM has described the node tree of a stratification, allows developer to add, remove and revise certain part of the page, and can obtain the access to node;
When user clicks a certain position on webpage, can on this node, trigger (onclick) event of click, and along dom tree always upwards on path each node trigger successively, until bubbling is to document (Document) node, because the visible node on the page is all the child node of <body> node, can generate thus the unique path to Event triggered node by <body>;
Step (a2), text node interior location acquisition of information; Wherein:
For the text node on the page, need to find out the particular location that user clicks in text;
A scope is founded in the position of clicking the mouse user, after obtaining this scope, change respectively in its front and back side-play amount examination scope whether can comprise effective word, if, return to this scope with respect to the initial offset of text node, as the positional information of text node inside;
Step (a3), non-text node interior location acquisition of information; Wherein:
For the non-text node on the page, need to determine that user click event is with respect to the offset information of element, the event attribute that can be provided by DOM: event X skew (event.offsetX) and event Y skew (event.offsetY) obtain;
Step (a4), markup information obtain; Wherein:
When user marks on webpage, in the page, insert mark layer, according to different situations, to mark layer the position for one of step (a2) text node interior location information getting method or the non-text node interior location of step (a3) information getting method obtain, or directly obtain the mark layer side-play amount with respect to full page;
The realization of step (2), instant messaging, specific as follows:
The structure of step (b1), message transfer; Wherein:
The content of message is that the <message> node by defining in XMPP agreement transmits, except <body> node is transferring text, in <message> node, add more child node to reach the location information function of transmitting collaborative browse, insertion position information node, transmit collaborative browse positional information, for JavaScript object transfer, JavaScript object is converted to json object, a character string is transmitted,
The parsing of step (b2), message transfer is with compatible; Wherein:
For the instant messaging network that adopts XMPP agreement, when resolving the XML file of XMPP transmission, only can resolve the part of this network support, if by this project and common GTalk user communication, other child nodes in <message> node except <body> node can be ignored automatically, message deteriorates to a common text message, need not change system can realize the compatibility with each main flow instant communicating system;
The parsing of step (3), collaborative browse information, wherein,
The parsing of described step (3) collaborative browse information further comprises:
Step (c1), node location information are resolved;
Step (c2), intra-node positional information are resolved;
Step (c3), markup information are resolved.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210044653.0A CN102637193B (en) | 2012-02-23 | 2012-02-23 | Webpage instant collaborative browsing method based on DOM (document object model) and XMPP (extensible messaging and presence protocol) |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210044653.0A CN102637193B (en) | 2012-02-23 | 2012-02-23 | Webpage instant collaborative browsing method based on DOM (document object model) and XMPP (extensible messaging and presence protocol) |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102637193A CN102637193A (en) | 2012-08-15 |
CN102637193B true CN102637193B (en) | 2014-12-03 |
Family
ID=46621587
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210044653.0A Expired - Fee Related CN102637193B (en) | 2012-02-23 | 2012-02-23 | Webpage instant collaborative browsing method based on DOM (document object model) and XMPP (extensible messaging and presence protocol) |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102637193B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103365859B (en) * | 2012-03-28 | 2017-03-08 | 上海商派网络科技有限公司 | The method processing webpage mouse click event |
CN103324668A (en) * | 2013-05-20 | 2013-09-25 | 吴涛军 | Marking system for marking texts on web pages |
CN104683421B (en) * | 2013-12-03 | 2017-12-29 | 中国科学院声学研究所 | A kind of WEB service method for supporting more equipment synchronous bearers |
EP3136656B1 (en) | 2014-05-23 | 2020-07-15 | Huawei Technologies Co., Ltd. | Information sharing method and device |
CN104516865B (en) * | 2014-12-29 | 2017-09-19 | 北京大学 | Association desktop based on Web demonstrates the online presentation file edit methods of subdocument |
CN105024923B (en) * | 2015-07-29 | 2018-05-15 | 北京梅泰诺通信技术股份有限公司 | The method and device that message category based on XMPP extension message is realized |
CN107368465B (en) * | 2016-05-13 | 2020-03-03 | 北京京东尚科信息技术有限公司 | System and method for processing screenshot note of streaming document |
CN107633019A (en) * | 2017-08-24 | 2018-01-26 | 阿里巴巴集团控股有限公司 | A kind of page events acquisition method and device |
CN108509189B (en) * | 2018-04-13 | 2019-09-10 | 南京新贝金服科技有限公司 | A kind of component of the H5 time gate based on DOM unifies implementation method |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101197849A (en) * | 2007-12-21 | 2008-06-11 | 腾讯科技(深圳)有限公司 | Method and device for commuting internet page into wireless application protocol page |
-
2012
- 2012-02-23 CN CN201210044653.0A patent/CN102637193B/en not_active Expired - Fee Related
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101197849A (en) * | 2007-12-21 | 2008-06-11 | 腾讯科技(深圳)有限公司 | Method and device for commuting internet page into wireless application protocol page |
Also Published As
Publication number | Publication date |
---|---|
CN102637193A (en) | 2012-08-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102637193B (en) | Webpage instant collaborative browsing method based on DOM (document object model) and XMPP (extensible messaging and presence protocol) | |
JP6427159B2 (en) | Interacting with spreadsheets using text messages | |
Wang | Improving data transmission in web applications via the translation between XML and JSON | |
CN101763423B (en) | Method for realizing presentation of tree-structure data in World Wide Web page as well as system and device therefor | |
CN201298231Y (en) | Multilingual communication and application system capable of automatically identifying multilanguage | |
CN103973737A (en) | Method, server and browser for actively pushing messages | |
CN103488754B (en) | A kind of method of transparent interoperability between heterogeneous profiles cooperation cloud service | |
CN104717185A (en) | Display and response method, device, server and system for short uniform resource locator | |
CN104050287A (en) | Method and system for replying messages during instant chat | |
US20140074954A1 (en) | Method, system and device for implementing reposting to microblog | |
CN101465817A (en) | Method, server and system for transmitting network community message | |
CN102831150B (en) | Browser and local exchange method, system and the terminal applied | |
CN102054042A (en) | Service method and site for exchanging knowledge information and question and answer exchange platform | |
Shinavier | Real-time# SemanticWeb in<= 140 chars | |
CN103297498A (en) | Relevant content pushing method based on mobile phone client side | |
US8706909B1 (en) | Systems and methods for semantic URL handling | |
CN103853753A (en) | Method and system for sharing webpage contents | |
CN102236676A (en) | Method and device for acquiring picture information by session window | |
CN103841121B (en) | A kind of comment and interaction systems and method based on local file | |
CN104021177A (en) | Information integration method with combination of semantic network and geographic information features | |
Snaith et al. | Implementing argublogging | |
CN103279361A (en) | Uniform literature sharing device and method driven by small bookmarks | |
CN105407076A (en) | Method and system for achieving media bridge | |
US20140304349A1 (en) | Method and system for replying to website update event | |
CN102694741B (en) | Microblogging integration method, microblogging terminal, microblogging list, microblog topic server and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20141203 Termination date: 20150223 |
|
EXPY | Termination of patent right or utility model |