CN109446459B - Page switching method and device, electronic equipment and storage medium - Google Patents

Page switching method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109446459B
CN109446459B CN201811185131.6A CN201811185131A CN109446459B CN 109446459 B CN109446459 B CN 109446459B CN 201811185131 A CN201811185131 A CN 201811185131A CN 109446459 B CN109446459 B CN 109446459B
Authority
CN
China
Prior art keywords
page
uniform resource
resource locator
original
bound
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.)
Active
Application number
CN201811185131.6A
Other languages
Chinese (zh)
Other versions
CN109446459A (en
Inventor
张宁
邢国杰
杨浩为
赵金鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN201811185131.6A priority Critical patent/CN109446459B/en
Publication of CN109446459A publication Critical patent/CN109446459A/en
Priority to CA3058070A priority patent/CA3058070A1/en
Application granted granted Critical
Publication of CN109446459B publication Critical patent/CN109446459B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a page switching method and device, electronic equipment and a storage medium, and relates to the technical field of software engineering. The method comprises the following steps: before switching the original label page into a target label page, determining whether a uniform resource locator bound by the original label page needs to be adjusted; if the uniform resource locator bound by the original label page needs to be adjusted is determined, the original label page is bound with the uniform resource locator of the current display page of the original label page; if the uniform resource locator bound by the original label page does not need to be adjusted, directly switching the original label page into a target label page; and if a switching instruction for jumping back to the original label page is received, displaying a page corresponding to the uniform resource locator bound with the original label page on the original label page. According to the technical scheme of the embodiment of the invention, the user can quickly return to the previously browsed position when switching the tab page, and the operation convenience of single-page application is improved.

Description

Page switching method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of software engineering technologies, and in particular, to a page switching method, a page switching apparatus, an electronic device, and a computer-readable storage medium.
Background
With the development of internet technology, Single Page Web Application (SPA) is widely used. A single-page application is an application that has only one Web page, and is a Web application that loads a single HTML (HyperText Markup Language) page and dynamically updates the page as the user interacts with the application.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the invention and therefore may include information that does not constitute prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
An object of the embodiments of the present invention is to provide a page switching method, a page switching apparatus, an electronic device, and a computer-readable storage medium, so as to overcome at least to some extent the problem that a last displayed page is lost when a single-page application is switched back and forth between tab pages due to limitations and defects of the related art.
According to a first aspect of the embodiments of the present invention, there is provided a page switching method, including: before switching an original label page into a target label page, determining whether a uniform resource locator bound by the original label page needs to be adjusted; if the uniform resource locator bound by the original label page needs to be adjusted is determined, the original label page is bound with the uniform resource locator of the current display page of the original label page; if the uniform resource locator bound by the original label page is determined not to need to be adjusted, directly switching the original label page into the target label page; and if a switching instruction of jumping back to the original label page is received, displaying a page corresponding to the uniform resource locator bound with the original label page on the original label page.
In some example embodiments of the present invention, determining whether the uniform resource locator of the original tab page binding needs to be adjusted based on the foregoing scheme includes: judging whether the uniform resource locator bound by the original label page is the uniform resource locator of the page displayed last; if the uniform resource locator of the page displayed at last is judged, determining that the uniform resource locator bound by the original label page does not need to be adjusted; and if the uniform resource locator is not the uniform resource locator of the page displayed last, determining the uniform resource locator bound by the original label page to be adjusted.
In some example embodiments of the present invention, based on the foregoing scheme, determining whether the uniform resource locator bound to the original tab page is the uniform resource locator of the page displayed last includes: acquiring a timestamp of a display page corresponding to the uniform resource locator bound with the original tag page; and judging whether the uniform resource locator bound by the original label page is the uniform resource locator of the last displayed page or not based on the timestamp.
In some example embodiments of the present invention, based on the foregoing solution, the page switching method further includes: and recording page state data of the current display page when the original label page is bound with the uniform resource locator of the current display page of the original label page.
In some example embodiments of the present invention, based on the foregoing scheme, the binding the original tab page and the uniform resource locator of the currently displayed page of the original tab page includes: and binding the original label page with the uniform resource locator of the current display page of the original label page through a JavaScript script.
In some example embodiments of the present invention, based on the foregoing solution, the page switching method further includes: and storing the uniform resource locators corresponding to the label pages in the single-page application into the memory of the browser in an array form according to the sequence to form a binding relationship.
In some example embodiments of the present invention, based on the foregoing solution, the page switching method further includes: if the display content of the current tab page changes, dynamically adjusting the uniform resource identifier corresponding to the current tab page in the array, and updating the binding relationship.
According to a second aspect of embodiments of the present invention, there is provided a communication apparatus including: the system comprises a judging unit, a judging unit and a judging unit, wherein the judging unit is used for determining whether the uniform resource locator bound by an original label page needs to be adjusted or not before the original label page is switched to a target label page; a determining and binding unit, configured to bind the original tab page with the uniform resource locator of the currently displayed page of the original tab page if it is determined that the uniform resource locator bound to the original tab page needs to be adjusted; a direct switching unit, configured to directly switch the original tab page to the target tab page if it is determined that the uniform resource locator bound to the original tab page does not need to be adjusted; and the page recovery unit is used for displaying a page corresponding to the uniform resource locator bound with the original label page on the original label page if a switching instruction for jumping back to the original label page is received.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus, including: a processor; and a memory having computer readable instructions stored thereon which, when executed by the processor, implement the page switching method according to any one of the above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the page switching method according to any one of the above.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the page switching method in the exemplary embodiment of the invention, before switching the original tab page to the target tab page, whether the uniform resource locator bound to the original tab page needs to be adjusted is determined; if the uniform resource locator bound by the original label page needs to be adjusted, the original label page is bound with the uniform resource locator of the current display page of the original label page; if the uniform resource locator bound by the original label page is determined not to need to be adjusted, directly switching the original label page into a target label page; and if a switching instruction for recovering the original label page is received, displaying a page corresponding to the uniform resource locator bound with the original label page on the original label page. When the new tab page is switched, the uniform resource locator is bound again according to the page state of the current tab page, and when the original tab page is returned, the page state before the tab page is switched is loaded according to the bound uniform resource locator, so that the previous browsing page can be returned accurately and quickly, the operation is simplified, and the operation convenience of single-page application is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 schematically illustrates a flow diagram of a page switching method according to some embodiments of the invention;
FIG. 2 is a schematic diagram illustrating a uniform resource locator rebinding in accordance with some embodiments of the invention;
FIG. 3 schematically illustrates a diagram of restoring an original tab page, according to some embodiments of the invention;
FIG. 4 schematically illustrates a schematic view of a page switching apparatus according to some embodiments of the invention;
FIG. 5 schematically illustrates a schematic diagram of a computer system of an electronic device, in accordance with some embodiments of the invention;
FIG. 6 schematically illustrates a schematic diagram of a computer-readable storage medium according to some embodiments of the invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals denote the same or similar parts in the drawings, and thus, a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations or operations have not been shown or described in detail to avoid obscuring aspects of the invention.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
At present, a large single-page application generally organizes pages in the form of Tab pages, each Tab page includes one or more pages, when a user browses a page below Tab page 1, pages in Tab page 1 jump continuously, and after the jump, if the user switches from Tab page 1 to Tab page 2, since a default page below Tab page 1 is an initial display page, and then when the user switches back to Tab page 1, the default initial display page is displayed, the content displayed in previous Tab page 1 may be lost, and if the user wants to view the content browsed previously, the user needs to reselect to perform an operation, which is cumbersome.
The inventors have noted this problem and developed a page switching method, and fig. 1 schematically shows a flow schematic block diagram of a page switching method according to some embodiments of the present invention. Referring to fig. 1, the page switching method includes the following steps:
step S110, before switching the original label page into the target label page, determining whether the uniform resource locator bound by the original label page needs to be adjusted;
step S120, if the uniform resource locator bound by the original label page needs to be adjusted is determined, the original label page is bound with the uniform resource locator of the current display page of the original label page;
step S130, if the uniform resource locator bound by the original label page does not need to be adjusted, directly switching the original label page into the target label page;
step S140, if a switching instruction to jump back to the original tab page is received, displaying a page corresponding to the uniform resource locator bound to the original tab page on the original tab page.
According to the page switching method in the embodiment of the invention, when a new tab is switched, the uniform resource locator is re-bound according to the page state of the current tab, and when the original tab is returned, the page state before the tab is switched is loaded according to the re-bound uniform resource locator, so that the tab can be accurately and quickly returned to the previous browsing position, the operation is simplified, and the operation convenience of single-page application is improved.
Next, the page switching method of the present exemplary embodiment will be further explained.
Referring to fig. 1, in step S110, before switching an original tab page to a target tab page, it is determined whether a uniform resource locator bound to the original tab page needs to be adjusted.
In some example embodiments of the invention, a Uniform Resource Locator (URL) is an address of a standard Resource on the internet that may be used to determine the location of a particular file contained in the Resource. And when the instruction for switching the label page needs to be executed, namely the original label page is switched to the target label page, judging whether the uniform resource locator bound by the original label page needs to be adjusted or not.
In some example embodiments of the present invention, when an instruction for switching a tab page needs to be executed, whether a display page of an original tab page and a uniform resource locator change is detected, and if the display page of the original tab page changes each time, the original tab page and the uniform resource locator of a page after the change are bound, and at this time, it is considered that the uniform resource locator bound by the original tab page has been adjusted, so that the instruction for switching the tab page can be directly executed without adjusting the uniform resource locator bound by the original tab page again.
In some example embodiments of the present invention, when an instruction for switching a tab page needs to be executed, whether a display page of an original tab page and a uniform resource locator change is detected, and if the display page of the original tab page changes each time, the uniform resource locator bound to the original tab page does not change, it is considered that the uniform resource locator bound to the original tab page corresponds to a history display page, and therefore, the uniform resource locator bound to the original tab page needs to be readjusted, so that the uniform resource locator bound to the original tab page can be located to a current display page.
In some example embodiments of the present invention, when determining whether the uniform resource locator bound to the original tab page needs to be adjusted, the determining may further be performed by determining whether the uniform resource locator bound to the original tab page is the uniform resource locator of the last displayed page. If the uniform resource locator of the page displayed at last is judged, determining that the uniform resource locator bound by the original label page is adjusted, and not needing to be adjusted again; and if the uniform resource locator is not the uniform resource locator of the last displayed page, determining that the uniform resource locator bound by the original tab page corresponds to the history displayed page, and needing to readjust the uniform resource locator bound by the original tab page.
Further, when the display page changes, a time stamp is set for the display page of the original tab page. And acquiring a time stamp of a display page corresponding to the uniform resource locator bound by the original tag page, and judging whether the uniform resource locator bound by the original tag page is the uniform resource locator of the last displayed page or not according to the time stamp.
In step S120, if it is determined that the uniform resource locator bound to the original tab page needs to be adjusted, the original tab page is bound to the uniform resource locator of the currently displayed page of the original tab page.
In some example embodiments of the present invention, if it is determined that the uniform resource locator bound to the original tab page needs to be adjusted, that is, when the displayed page of the original tab page changes and the uniform resource locator bound to the original tab page does not change, or it is determined that the uniform resource locator bound to the original tab page is not the uniform resource locator of the last displayed page, the uniform resource locator of the current displayed page of the original tab page is bound to the original tab page.
Further, when the uniform resource locator bound to the original tab page is determined to need to be adjusted, the uniform resource locator of the original tab page and the currently displayed page of the original tab page can be bound through the JavaScript script.
In step S130, if it is determined that the uniform resource locator bound to the original tab page does not need to be adjusted, the original tab page is directly switched to the target tab page.
In some example embodiments of the present invention, if it is determined that the uniform resource locator bound to the original tab page does not need to be adjusted, that is, the original tab page and the uniform resource locator of the page after the change are bound each time the display page of the original tab page changes, or it is determined that the uniform resource locator bound to the original tab page is the uniform resource locator of the page displayed last, the original tab page is directly switched to the target tab page.
In step S140, if a switching instruction to jump back to the original tab page is received, a page corresponding to the uniform resource locator bound to the original tab page is displayed on the original tab page.
In some example embodiments of the present invention, if a switching instruction to restore to an original tab page is received, a uniform resource locator of the original tab page that is newly bound is obtained, page state data recorded corresponding to the uniform resource locator is loaded, the page state data is displayed on the original tab page, and a page displayed last before the original tab page is switched is restored.
Further, when the original tab page is bound with the uniform resource locator of the currently displayed page of the original tab page, page state data, such as login state data, of the currently displayed page is recorded. When a command for recovering the original tab page is received, the page state data corresponding to the rebind uniform resource locator is loaded, so that the recovery of the last displayed page of the original tab page can be completed, and the login state of the last displayed page can be maintained.
In addition, in some embodiments, before the original tab page is switched to the target tab page, all contents of a currently displayed page of the original tab page may also be loaded into the browser, and the currently displayed page is controlled to be hidden by a display attribute of HTML (HyperText Markup Language). And when a switching instruction for recovering the original tab page is received, controlling and displaying the current display page through the display attribute of the HTML.
Further, in an example embodiment, the uniform resource locators corresponding to the tab pages in the single-page application are stored in the browser memory in an array form according to the sequence to form a binding relationship. If the display content of the current tab page changes, dynamically adjusting the uniform resource symbol corresponding to the current tab page in the array, and updating the binding relationship. By caching the binding relationship between the label page and the same resource locator in the browser, the browser can return to the previous browsing position more accurately and quickly, and the operation convenience of single-page application is further improved.
FIG. 2 schematically illustrates a uniform resource locator rebinding in accordance with some embodiments of the invention. Referring to FIG. 2, the current single page application includes Tab Page 1, Tab1, Tab Page 2, Tab2, and Tab Page 3, Tab3, wherein before the switching operation, Tab Page 1 binds to URL www.meituan.com/Tab1, Tab Page 2 binds to URL www.meituan.com/Tab2, and Tab Page 3 binds to URL www.meituan.com/Tab 3; when switching to 'list entry 2', detecting that the display page is changed, recording the timestamp of the historical display page, such as '9: 30 AM', according to the display state of the current display page, rebinding the URL of the Tab page 1 to 'www.meituan.com/Tab 1/detail' through a JavaScript tool, when executing the next page switching instruction, storing the page state data of the current display page, and recording the timestamp of the page, such as '9: 40 AM'; when the tab page 1 is switched to the tab page 2, the display page of the tab page 1 is changed, the uniform resource locator bound by the original tab page is bound again, and the uniform resource locator bound by the tab page 1 is known to be the last displayed page according to the timestamp, so that the uniform resource locator bound by the tab page 1 does not need to be adjusted again. And recording the page state data of the current display page, and switching to the display page corresponding to the uniform resource locator 'www.meituan.com/Tab 2' bound to the Tab page 2.
FIG. 3 schematically illustrates a schematic diagram of restoring an original tab page, according to some embodiments of the invention. Referring to fig. 3, when the binding uniform resource locator of the Tab page 2 before operation is "www.meituan.com/Tab 2", and an instruction to switch from the Tab page 2 to the Tab page 1 is executed, the uniform resource locator of the Tab page 2 is rebinding by a JavaScript script tool according to the display state of the currently displayed page, and a timestamp of the page, for example, "9: 42 AM", is recorded; and detecting an instruction for recovering the tab page 1, acquiring the uniform resource locator of the tab page 1 rebinding in the diagram 2, loading the display page and the page state data corresponding to the uniform resource locator, and recovering the browsing state of the tab page 1 before switching.
In addition, in the embodiment of the invention, a page switching device is also provided. Referring to fig. 4, the page switching apparatus 400 includes: a judging unit 410, a binding determining unit 420, a direct switching unit 430, and a page restoring unit 440. Wherein: the determining unit 410 is configured to determine whether a uniform resource locator bound to an original tab page needs to be adjusted before the original tab page is switched to a target tab page; the determining and binding unit 420 is configured to bind the original tab page with the uniform resource locator of the currently displayed page of the original tab page if it is determined that the uniform resource locator bound to the original tab page needs to be adjusted; the direct switching unit 430 is configured to directly switch the original tab page to the target tab page if it is determined that the uniform resource locator bound to the original tab page does not need to be adjusted; the page restoring unit 440 is configured to display, on the original tab page, a page corresponding to the uniform resource locator bound to the original tab page if a switching instruction for jumping back to the original tab page is received.
In some example embodiments of the present invention, based on the foregoing scheme, the determining unit 410 further includes: a uniform resource locator judging unit, configured to judge whether the uniform resource locator bound to the original tab page is a uniform resource locator of a page to be displayed last; the first judging unit is used for determining the uniform resource locator bound by the original label page without adjusting if the uniform resource locator is the uniform resource locator of the page displayed at last; and the second judging unit is used for determining the uniform resource locator bound by the original label page to be adjusted if the uniform resource locator is judged not to be the uniform resource locator of the page displayed at last.
In some example embodiments of the present invention, based on the foregoing scheme, the uniform resource locator determination unit is configured to: acquiring a timestamp of a display page corresponding to the uniform resource locator bound with the original tag page; and judging whether the uniform resource locator bound by the original label page is the uniform resource locator of the last displayed page or not based on the timestamp.
In some example embodiments of the present invention, based on the foregoing solution, the page switching device is configured to: and recording page state data of the current display page when the original label page is bound with the uniform resource locator of the current display page of the original label page.
In some example embodiments of the present invention, based on the foregoing scheme, the original tab page is bound to the uniform resource locator of the currently displayed page of the original tab page through a JavaScript script.
In some example embodiments of the present invention, based on the foregoing solution, the page switching apparatus further includes: and the binding relationship forming unit is used for storing the uniform resource locators corresponding to the label pages in the single-page application into the memory of the browser in an array form according to the sequence to form the binding relationship.
In some example embodiments of the present invention, based on the foregoing solution, the page switching apparatus further includes: and the binding relationship updating unit is used for dynamically adjusting the uniform resource identifier corresponding to the current label page in the array and updating the binding relationship if the display content of the current label page changes.
The specific details of each module of the page switching device have been described in detail in the corresponding page switching method, and therefore are not described herein again.
It should be noted that although several modules or units of the page switching apparatus are mentioned in the above detailed description, such division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the invention. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the page switching method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 500 according to such an embodiment of the invention is described below with reference to fig. 5. The electronic device 500 shown in fig. 5 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the electronic device 500 is embodied in the form of a general purpose computing device. The components of the electronic device 500 may include, but are not limited to: the at least one processing unit 510, the at least one memory unit 520, a bus 530 connecting various system components (including the memory unit 520 and the processing unit 510), and a display unit 540.
Wherein the storage unit stores program code that is executable by the processing unit 510 to cause the processing unit 510 to perform steps according to various exemplary embodiments of the present invention as described in the above section "exemplary methods" of the present specification. For example, the processing unit 510 may execute step S110 shown in fig. 1, before switching the original tab page to the target tab page, to determine whether the uniform resource locator bound to the original tab page needs to be adjusted; step S120, if the uniform resource locator bound by the original label page needs to be adjusted is determined, the original label page is bound with the uniform resource locator of the current display page of the original label page; step S130, if the uniform resource locator bound by the original label page does not need to be adjusted, directly switching the original label page into the target label page; step S140, if a switching instruction to jump back to the original tab page is received, displaying a page corresponding to the uniform resource locator bound to the original tab page on the original tab page.
The memory unit 520 may include a readable medium in the form of a volatile memory unit, such as a random access memory unit (RAM)5201 and/or a cache memory unit 5202, and may further include a read only memory unit (ROM) 5203.
Storage unit 520 may also include a program/utility 5204 having a set (at least one) of program modules 5205, such program modules 5205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 530 may be one or more of any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 500 may also communicate with one or more external devices 570 (e.g., keyboard, pointing device, Bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 500, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 500 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 550. Also, the electronic device 500 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 560. As shown, the network adapter 560 communicates with the other modules of the electronic device 500 over the bus 530. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the page switching method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium 600 having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above-mentioned "exemplary methods" section of the present description, when said program product is run on the terminal device.
Referring to fig. 6, a program product 600 for implementing the page switching method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program codes, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (9)

1. A page switching method is applied to a single-page application comprising a plurality of tab pages, and is characterized by comprising the following steps:
before switching an original label page into a target label page, determining whether a uniform resource locator bound by the original label page needs to be adjusted;
if the uniform resource locator bound by the original label page needs to be adjusted is determined, the original label page is bound with the uniform resource locator of the current display page of the original label page;
if the uniform resource locator bound by the original label page is determined not to need to be adjusted, directly switching the original label page into the target label page;
if a switching instruction of jumping back to the original label page is received, displaying a page corresponding to a uniform resource locator bound with the original label page on the original label page;
wherein the determining whether the uniform resource locator bound to the original tab page needs to be adjusted includes:
judging whether the uniform resource locator bound by the original label page is the uniform resource locator of the page displayed last;
if the uniform resource locator of the page displayed at last is judged, determining that the uniform resource locator bound by the original label page does not need to be adjusted;
and if the uniform resource locator is not the uniform resource locator of the page displayed last, determining the uniform resource locator bound by the original label page to be adjusted.
2. The page switching method according to claim 1, wherein the step of determining whether the url bound to the original tab page is the url of the page to be displayed last comprises:
acquiring a timestamp of a display page corresponding to the uniform resource locator bound with the original tag page;
and judging whether the uniform resource locator bound by the original label page is the uniform resource locator of the last displayed page or not based on the timestamp.
3. The page switching method of claim 1, further comprising:
and recording page state data of the current display page when the original label page is bound with the uniform resource locator of the current display page of the original label page.
4. The page switching method according to any one of claims 1 to 3, wherein binding the original tab page with a uniform resource locator of a currently displayed page of the original tab page comprises:
and binding the original label page with the uniform resource locator of the current display page of the original label page through a JavaScript script.
5. The page turning method according to claim 4, further comprising:
and storing the uniform resource locators corresponding to the label pages in the single-page application into the memory of the browser in an array form according to the sequence to form a binding relationship.
6. The page switching method according to claim 5, further comprising:
if the display content of the current tab page changes, dynamically adjusting the uniform resource identifier corresponding to the current tab page in the array, and updating the binding relationship.
7. A page switching apparatus, comprising:
the system comprises a judging unit, a judging unit and a judging unit, wherein the judging unit is used for determining whether the uniform resource locator bound by an original label page needs to be adjusted or not before the original label page is switched to a target label page;
a determining and binding unit, configured to bind the original tab page with the uniform resource locator of the currently displayed page of the original tab page if it is determined that the uniform resource locator bound to the original tab page needs to be adjusted;
a direct switching unit, configured to directly switch the original tab page to the target tab page if it is determined that the uniform resource locator bound to the original tab page does not need to be adjusted;
the page recovery unit is used for displaying a page corresponding to the uniform resource locator bound with the original label page on the original label page if a switching instruction for jumping back to the original label page is received;
wherein the judging unit is further configured to:
judging whether the uniform resource locator bound by the original label page is the uniform resource locator of the page displayed last;
if the uniform resource locator of the page displayed at last is judged, determining that the uniform resource locator bound by the original label page does not need to be adjusted;
and if the uniform resource locator is not the uniform resource locator of the page displayed last, determining the uniform resource locator bound by the original label page to be adjusted.
8. An electronic device, comprising: a processor; and a memory having computer readable instructions stored thereon which, when executed by the processor, implement the page switching method of any one of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the page switching method according to any one of claims 1 to 6.
CN201811185131.6A 2018-10-11 2018-10-11 Page switching method and device, electronic equipment and storage medium Active CN109446459B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201811185131.6A CN109446459B (en) 2018-10-11 2018-10-11 Page switching method and device, electronic equipment and storage medium
CA3058070A CA3058070A1 (en) 2018-10-11 2019-10-09 Page switching method and device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811185131.6A CN109446459B (en) 2018-10-11 2018-10-11 Page switching method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109446459A CN109446459A (en) 2019-03-08
CN109446459B true CN109446459B (en) 2021-08-27

Family

ID=65545236

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811185131.6A Active CN109446459B (en) 2018-10-11 2018-10-11 Page switching method and device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN109446459B (en)
CA (1) CA3058070A1 (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111752699B (en) * 2019-03-27 2024-04-09 北京沃东天骏信息技术有限公司 Page switching method, device and computer readable storage medium
CN111275517B (en) * 2020-01-14 2021-02-19 拉扎斯网络科技(上海)有限公司 Link information display method and device, storage medium and terminal
CN111596832B (en) * 2020-05-20 2022-04-08 北京搜狗智能科技有限公司 Page switching method and device
CN111625167B (en) * 2020-05-28 2021-08-24 上海哔哩哔哩科技有限公司 Page switching method and device and computer equipment
CN112100555B (en) * 2020-08-18 2024-06-25 北京思特奇信息技术股份有限公司 Method and system for realizing single-page application in native HTML5 page
CN112100476A (en) * 2020-09-01 2020-12-18 武汉华盛美业科技有限公司 Dynamic data acquisition method and system for single-page multi-state object
CN112632920B (en) * 2020-11-16 2021-11-23 腾讯科技(深圳)有限公司 Link processing method, link processing device, terminal equipment and storage medium
CN112685663B (en) * 2020-12-21 2023-05-12 福建新大陆软件工程有限公司 SPA multi-tab management method based on VUE
CN112579934A (en) * 2021-02-03 2021-03-30 杭州普数软件有限公司 Method and equipment for skipping and updating view of website application
CN114741149B (en) * 2022-04-15 2024-02-27 北京懿医云科技有限公司 Page switching method and device for single-page application, storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103984686A (en) * 2013-02-07 2014-08-13 阿里巴巴集团控股有限公司 Page-switching method and device
CN104978385A (en) * 2015-03-19 2015-10-14 腾讯科技(深圳)有限公司 Information processing method, browser client and terminal
CN105550187A (en) * 2014-11-03 2016-05-04 阿里巴巴集团控股有限公司 Method and device for managing browsing history in single page application
CN106201562A (en) * 2015-04-30 2016-12-07 深圳市腾讯计算机***有限公司 A kind of page switching method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10055308B2 (en) * 2015-08-17 2018-08-21 Sap Portals Israel Ltd. System and method of data loss prevention

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103984686A (en) * 2013-02-07 2014-08-13 阿里巴巴集团控股有限公司 Page-switching method and device
CN105550187A (en) * 2014-11-03 2016-05-04 阿里巴巴集团控股有限公司 Method and device for managing browsing history in single page application
CN104978385A (en) * 2015-03-19 2015-10-14 腾讯科技(深圳)有限公司 Information processing method, browser client and terminal
CN106201562A (en) * 2015-04-30 2016-12-07 深圳市腾讯计算机***有限公司 A kind of page switching method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
A Test Environment for Web Single Page Applications (SPA);Hans Findel等;《In Proceedings of the 11th International Conference on Web Information Systems and Technologies (WEBIST-2015)》;20151231;第47-54页 *
PhoneGap+HTML5+SPA微信公众平台实现;刘白林等;《西安工业大学学报》;20170630;第37卷(第6期);第448-452页 *

Also Published As

Publication number Publication date
CN109446459A (en) 2019-03-08
CA3058070A1 (en) 2020-04-11

Similar Documents

Publication Publication Date Title
CN109446459B (en) Page switching method and device, electronic equipment and storage medium
US8069223B2 (en) Transferring data between applications
US9485240B2 (en) Multi-account login method and apparatus
US9436772B2 (en) Appending a uniform resource identifier (URI) fragment identifier to a uniform resource locator (URL)
CN106649543B (en) Method, device and terminal for recording reading progress
CN113239672B (en) Target file editing method and device, electronic equipment and storage medium
CN107045546B (en) Webpage processing method and device and intelligent terminal
CN114065080B (en) Page rendering method, device, equipment and computer readable storage medium
CN114741149B (en) Page switching method and device for single-page application, storage medium and electronic equipment
EP2715543A2 (en) Redirecting requests to secondary location during temporary outage
CN113946253A (en) Rich media display method, medium, device and computing equipment
JP2010079796A (en) Proxy server, and method and program for controlling same
CN105573579A (en) Search bar operation method and terminal
CN116484130A (en) Page loading method, device, equipment, medium and program product
CN113489678A (en) Network protocol switching method and device, computing equipment and storage medium
CN112256991B (en) Method and equipment for native rendering of information flow fusing multiple link addresses
CN114254229A (en) Webpage rendering method and device
CN110727889A (en) Static webpage resource loading method, device, medium and electronic equipment
CN114510284A (en) Page loading method and device, electronic equipment and readable storage medium
CN112256992A (en) Native rendering method and device for information stream fusing multi-link addresses
EP3001311A1 (en) Method for automatically converting web applications into application that can be installed automatically on a plurality of platforms
CN107045549B (en) Method and device for acquiring page number of electronic book
CN111125565A (en) Method and equipment for inputting information in application
CN111562958A (en) Page data display management method and device
CN109284451B (en) Webpage pre-operation method, webpage browsing terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant