To judge the PC and the mobile side under MVC

Source: Internet
Author: User

The PC-side and mobile-side under MVC, in fact no different, the same way, just two points to change them

1th: Just click anywhere on this page to determine whether it is mobile or client:

2nd: New phone-side zone areas (Simply put: areas is equivalent to a small operating mechanism also has a controller-view-and routing address), moble (where the phone is stored)

: The mechanism of MVC running is simply-controller-Main page-whether template page-returns the page you clicked

: The key point is in this template page (_layout) and the own JS,

: When we run to the (_layout) here to determine whether it is a PC or mobile phone, do not ask me why in the template page in the judgment to read this sentence

: Direct Mapping

Please put it in

Mobile-side Routing Address

Client Routing Address

Here's another question: how do I judge this route?

window.location = "/m/"; This sentence is the focus, if the current mobile phone is on the routing address, beginning with M

So how does this m define it?

The red line in the picture is running to the address of the mobile phone, see which M, that's it

There is an error in the figure if there is no accident: that is the name of the routing address in the new zone and project under the project.

Http://www.cnblogs.com/LZXX/p/5828573.html here, I'm explaining the situation.

To judge the PC and the mobile side under MVC

Related Article

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.