Javascript-how does a js script become invalid when a mobile phone accesses a php page written on a computer?

Source: Internet
Author: User
Configuration: php + apache + mysql + windows level 2 menu is completed through js + css: The page displayed on the following mobile phone, the level-2 menu on the Left cannot be opened (the javascript script is not loaded at all, because the mouse does not open the level-2 menu): The page displayed on the computer...

Configuration: php + apache + mysql + windows

The second-level menu is completed through js + css:

The second-level menu on the left of the page displayed on the following mobile phone cannot be opened (the javascript script is not loaded at all because the cursor does not open the second-level menu ):

The page displayed on the computer is as follows:

Also, the width of the body content I set below is obtained through js screen resolution settings:
Var s_info = {

Width: window. screen. width, // valid height on the computer: window. screen. height

};
$ Id ('Con '). style. width = s_info.width * 0.95 + 'px'; // The $ id () function is customized by me.
The internal sub-elements are set by percentage. However, the page is shown in the first figure because the js script is not loaded on the mobile phone.

The following figure shows how Javascript script loading works by simulating the pictures on the mobile phone page (the second-level page is still open, and the js Script Loading is normal ):

The following is the content displayed in the source code on the page:

I just don't know. When testing on a mobile phone:
1: js script not loaded
2: During the test on the mobile phone, there were too many blank areas on the page (the first figure), but there was almost no blank area on the computer (the second figure)

For two problems, please solve them ....

Reply content:

Configuration: php + apache + mysql + windows

The second-level menu is completed through js + css:

The second-level menu on the left of the page displayed on the following mobile phone cannot be opened (the javascript script is not loaded at all because the cursor does not open the second-level menu ):

The page displayed on the computer is as follows:

Also, the width of the body content I set below is obtained through js screen resolution settings:
Var s_info = {

Width: window. screen. width, // valid height on the computer: window. screen. height

};
$ Id ('Con '). style. width = s_info.width * 0.95 + 'px'; // The $ id () function is customized by me.
The internal sub-elements are set by percentage. However, the page is shown in the first figure because the js script is not loaded on the mobile phone.

The following figure shows how Javascript script loading works by simulating the pictures on the mobile phone page (the second-level page is still open, and the js Script Loading is normal ):

The following is the content displayed in the source code on the page:

I just don't know. When testing on a mobile phone:
1: js script not loaded
2: During the test on the mobile phone, there were too many blank areas on the page (the first figure), but there was almost no blank area on the computer (the second figure)

For two problems, please solve them ....

Some js files are not supported on mobile phones.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.