Home  >  Article  >  Backend Development  >  I encountered a strange problem when loading the page. Please explain.

I encountered a strange problem when loading the page. Please explain.

WBOY
WBOYOriginal
2016-08-25 10:37:23991browse

A background program written in PHP. After clicking a link to jump to the page, the page on the right does not appear inexplicably. I encountered a strange problem when loading the page. Please explain.

Change the browser size or refresh the page and it will reappear.
I encountered a strange problem when loading the page. Please explain.

I have checked the source code of the webpage and reviewed the elements. Even when the screen on the right is white, the DOM elements are loaded. Why is this? First time encountered.

PS: Just change the page size to reappear the page.

Reply content:

A background program written in PHP. After clicking the link a to jump to the page, the page on the right does not appear inexplicably. I encountered a strange problem when loading the page. Please explain.

Change the browser size or refresh the page and it will reappear.
I encountered a strange problem when loading the page. Please explain.

I have checked the source code of the webpage and reviewed the elements. Even when the screen on the right is white, the DOM elements are loaded. Why is this? First time encountered.

PS: Just change the page size to reappear the page.

Because you did not give more specific error information, I can only guess that after the element on the right is loaded, the height, width, left, right, top, bottom, etc. of the style are not calculated and set properly.
But you said that you can make it appear by changing the window size. The easiest way may be to consider manually triggering the onresize event so that it can be automatically rearranged like changing the window size.

It is recommended that you check the element (css) to check whether the content has been loaded and whether the style of other elements affects it

Thank you for the invitation. Whether the page is loaded during initialization

In order to improve the loading speed of the page, is it possible that ajax loading is used inside the framework, and the page will not be refreshed as a whole?

Similar problems also occurred when I used the JqueryMobile framework to write mobile terminals.
My problem arises with data-ajax
data-ajax: Specifies whether to load the page through ajax to improve user experience and interaction. If set to false, jQuery Mobile will perform a normal page request.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn