A method and device for cross-browser data interaction based on browser protocol
A cross-browser, data interaction technology, applied in the Internet field, can solve the problem that controls cannot be used at the same time, achieve the effect of solving the problem of cross-browser use of controls and improving development efficiency
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0028] figure 1 It is a schematic diagram of the cross-browser data interaction method based on the browser protocol in the first embodiment of the present invention, a control solution that can realize cross-browser use.
[0029] Specifically, a browser protocol-based cross-browser data interaction method includes:
[0030] Step 1, the user terminal browser utilizes the JavaScript module to execute and call the local application program command according to the browser protocol;
[0031] Step 2. The local application creates a Webserver, and performs local simulation interaction with the Webserver through JavaScript;
[0032] Step 3. Call the JavaScript script file of the public server, dynamically add the JavaScript script file, further use the JavaScript module in the DOM to send cross-domain data, and the size of the single sent data does not exceed 2KB; further use the Get class request to find the header file; use The Create statement creates a JavaScript object;
[0...
Embodiment 2
[0037] like figure 2 As shown in , examples of the code fields involved in cross-domain data transmission are as follows:
[0038] " / / Find the document header
[0039] var head = document.getElementsByTagName('head')[0];
[0040] / / Generate a JS object
[0041] var jscript = document.createElement('script');
[0042] jscript.type = 'text / javascript';
[0043] / / send data
[0044] jscript.src="http: / / 127.0.0.1:"+jlink_port+" / "+"sent data";
[0045] / / Insert elements (insertBefore must be compatible with IE6)
[0046] head.insertBefore(jscript, head.firstChild);"
Embodiment 3
[0048] like image 3 As shown, the data callback and anti-reentrancy code examples are as follows:
[0049]
[0050] Example: 4:
[0051] like Figure 4 As shown, corresponding to the above method, the present invention also provides a cross-browser data interaction device 1 based on the browser protocol, including:
[0052] An application calling module 101, configured to call a local application;
[0053] The simulation interaction module 102 is used for local application programs to create a Webserver, and to perform local simulation interaction through JavaScript;
[0054] A cross-domain data sending module 103, configured to use the JavaScript module in the DOM to send cross-domain data;
[0055] The callback module 105 is configured to call back the returned data.
[0056] The data re-entry prohibiting module 104 is configured to prevent data re-entry.
[0057] The data fetching module 106 is used to fetch the returned data variables.
[0058] The device furthe...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More - R&D
- Intellectual Property
- Life Sciences
- Materials
- Tech Scout
- Unparalleled Data Quality
- Higher Quality Content
- 60% Fewer Hallucinations
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2025 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com



