Despite the need to avoid, but not to mention that the pit is often trampled, do not think that the mobile phone is Webkit the world is simple, do not handle compatibility between browsers,-in fact, the problem of inconsistency is quite large.
Two bugs are involved in the IFRAME--iframe really bad!
The thing is, a page embedded in the IFRAME, because it is necessary to return tokens from the authentication interface as login credentials, read the interface information is not a problem, and then need to use the session to save the login information. Strangely, the session is invalid, as if it were lost! It's okay to leave the IFRAME as a separate page. And not all phones are like this, high-version Android and Apple are like this (desktop and some versions of Android normal). We know that cookies are generally used on a one-to-one session, and it is not possible to use cookies as "pleasant" as the lower version, given the more sophisticated security mechanisms of the IFRAME cookies.
Then simply with party a said we "painstakingly", helpless under, had to use the most stupid method, through the URL parameter passed authentication data. Also several pages, add up also not so painful ...
The second pit is Apple-exclusive, and Safari can't constrain the width of the page within the IFRAME! Android is OK. Simply say that the embedded page will appear distorted on the mobile side, even if you add
<meta name="viewport" content="width=320, initial-scale=1, user-scalable=yes" />
is not valid. If you write a dead width then you will not be compatible with all Apple screens. So I centered the text, but some people do not agree with this does not conform to the beautiful approach, so I use JS read screen width and then write Document.body.style.width. Two lines of code to fix, the key is the idea.
Two pits encountered in recent mobile front-end projects