Server-Side JavaScript Execution for Mobile Web Browsing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Mobile terminals often lack the necessary CPU and memory resources to execute JavaScript in webpages, leading to incomplete or abnormal webpage display in browsers.
Innovation Solution
Deploying a webpage parsing server at the server side to execute JavaScript, adding JSNODE and Page Data attributes to the webpage, and transmitting the executed results to the mobile terminal, allowing the browser to display the webpage without executing JavaScript locally.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If JavaScript is executed in the mobile terminal browser, then the webpage can be displayed with full functionality, but the mobile terminal requires sufficient CPU and memory resources which low-end devices lack
Solution Approach 1:
The patent introduces a server-side JavaScript execution system as an intermediary between the mobile terminal and the webpage. The server executes JavaScript code and returns rendered HTML to the mobile terminal, eliminating the need for the terminal to execute JavaScript locally. This mediator approach allows low-end devices to access full webpage functionality without requiring sufficient local computational resources.
Solution Approach 2:
The patent implements a copying mechanism where the server executes JavaScript and generates a complete HTML output that is then copied and transmitted to the mobile terminal. The terminal displays this pre-executed HTML without needing to interpret or execute the original JavaScript, effectively creating a copy of the executed result that can be displayed with minimal local resources.
2Ease of operation
If JavaScript execution is performed on the mobile terminal, then webpage interactivity is maintained, but the terminal's processing capability is insufficient for complex JavaScript code
Solution Approach 1:
The server acts as an intermediary that handles all JavaScript execution complexity. The server receives JavaScript code, executes it in a controlled environment, and returns the resulting HTML to the mobile terminal. This mediator approach transfers the processing complexity from the terminal to the server, maintaining interactivity while reducing local processing requirements.
Solution Approach 2:
The server performs preliminary JavaScript execution before the mobile terminal needs to display the webpage. By executing JavaScript in advance and generating complete HTML output, the system prepares the webpage in a format that the terminal can display directly without needing to process complex JavaScript code locally.
3Speed
If JavaScript is executed locally in the browser, then the webpage can respond to user actions in real-time, but the mobile terminal cannot provide the necessary execution environment
Solution Approach 1:
The server serves as a reliable intermediary execution environment that consistently provides the necessary JavaScript runtime and processing capabilities. Since the server has sufficient computational resources and a stable execution environment, it can reliably execute JavaScript code and return results to the mobile terminal, ensuring consistent response performance without the reliability issues of running complex code on resource-constrained devices.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
According to an example, a method for displaying a webpage includes: A, obtaining, by the webpage parsing server, an original webpage corresponding to a Universal Resource Locator (URL) request transmitted by a mobile terminal, and executing JavaScript (JS) in the original webpage to obtain a result webpage; B, adding, by the webpage parsing server, a JSNODE attribute to the result webpage, transmitting the result webpage containing the JSNODE attribute to the mobile terminal, and the mobile terminal fills in a JS request protocol packet according to a JS event triggered by a user and the JSNODE attribute; and C, executing, by the webpage parsing server, the JS event according to the JS request protocol packet transmitted by the mobile terminal, and transmitting the result webpage in which the JS event has been executed to the mobile terminal for display.