Method and electronic device for optimizing picture lazy loading using front-end programming language

A programming language and lazy loading technology, applied in the direction of network data browsing optimization, program control device, user interface execution, etc., can solve problems such as poor performance of web page pictures, and achieve the effect of improving efficiency, improving performance and saving time

Inactive Publication Date: 2019-02-01
SHENZHEN DIANMAO TECH CO LTD
View PDF8 Cites 6 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0007] In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a method for optimizing lazy loading of images using a front-end programming language and an electronic device, aiming at solving the problem of poor performance of loading webpage images in the way of lazy loading of existing images

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and electronic device for optimizing picture lazy loading using front-end programming language
  • Method and electronic device for optimizing picture lazy loading using front-end programming language

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0040] The present invention provides a method for optimizing lazy loading of pictures by using a front-end programming language and an electronic device. In order to make the purpose, technical solution and effect of the present invention clearer and clearer, the present invention will be further described in detail below. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

[0041] see figure 1 , a method for optimizing lazy loading of images using a front-end programming language, which includes:

[0042] S1. When the webpage loads the cached image by lazy loading of the image, it is judged whether the current node of the cached image has been rendered;

[0043] S2. When the rendering of the current node of the cached picture is completed, display the predefined cached picture on the webpage;

[0044] S3. Obtain the target node of the target image, and determine whether th...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a method and an electronic device for optimizing picture lazy loading by utilizing a front-end programming language. The method comprises the following steps: when a web page loads a cached picture through a picture lazy loading mode, judging whether a current node of the cached picture is rendered or not; when the cached picture is loaded through a picture lazy loading mode, judging whether the cached picture is rendered or not. When the current node rendering of the cached picture is completed, displaying a pre-defined cached picture in a web page; obtaining the target node of the target picture, and judging whether the target node satisfies the preset picture attribute information, and whether the target node completes the rendering; When the target node satisfies the picture attribute information and the target node has completed rendering, the target address of the target picture is obtained, the target picture is loaded according to the target address, thecached picture is replaced by the target picture, and the target picture is displayed. In this way, it is not necessary to monitor the operation of the user on the web page, and the performance of lazy loading of pictures is improved, thus the loading efficiency of pictures on the web page is improved, and time is saved.

Description

technical field [0001] The invention relates to the field of front-end programming languages, in particular to a method for optimizing lazy loading of pictures by using the front-end programming language and electronic equipment. Background technique [0002] Web pages generally contain text and pictures. When a user sends a request to load a web page to the background server, the web page will receive the text and pictures sent by the background server. If the pictures on the webpage are loaded at the same time, there is a problem that the user views one of the positions of the webpage, but the picture at the corresponding position is not loaded. At this time, the user can only view other webpage positions that have displayed pictures. [0003] Image lazy loading is a way of loading images. Specifically, if a web page contains hundreds of pictures, when the user visits these pages (web pages), the waiting time is particularly long, that is to say, after receiving the user'...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/451G06F16/957
CPCG06F9/451
Inventor 孙悦李天驰李涛
Owner SHENZHEN DIANMAO TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products