Note for mobile wap page development and wap page note

Source: Internet
Author: User

Note for mobile wap page development and wap page note

I accidentally developed a mobile wap page and noted down some new things.


1. The page should be marked as a mobile wap page, which can increase the recognition of wap pages by Baidu and other tools.

Example: <! DOCTYPE html PUBLIC "-// WAPFORUM // dtd xhtml Mobile 1.0 //" http://www.wapforum.org/DTD/xhtml-mobile10.dtd ">

At the same time, marking "Apple *" at <title> is also conducive to retrieval by the search tool. (This is not recommended. After all, you need to change the title ).

Example: <title> Apple x mobile edition </title>


2. Set viewport. Meta viewport label usage instructions (mobile browser scaling Control)

Width-width of viewport
Height-the height of viewport
Initial-scale-initial scaling ratio
Minimum-scale-minimum scale allowed by users
Maximum-scale-maximum scale allowed by users
User-scalable-whether the user can manually Scale

For example: <meta name = "viewport" content = "width = 640, target-densitydpi = 320, user-scalable = no">


3. In addition, a js method for reading and writing Wap pages to and from local storage is provided.

/**
* Obtain the value in the local cache of the browser.
* @ Param name
* @ Returns
*/
Function getLocalValue (name ){
If (window. localStorage) {// HTML 5, applicable to mobile phones
If (localStorage. getItem (name) = null ){
LocalStorage. setItem (name, 0 );
}
// Alert ("HTML5 get:" + localStorage. getItem (name ));
Return localStorage. getItem (name );
} Else {
Var cookieArray = document. cookie. split (";"); // obtain the split cookie name value pair.
For (var I = 0; I <cookieArray. length; I ++ ){
Var arr = cookieArray [I]. split ("="); // separate names and values
If (arr [0] = name)
Return unescape (arr [1]); // If the cookie is specified, its value is returned.
}
Return "0 ";
}
}


/**
* Set the value in the local storage of the browser
* @ Param name, value
* @ Returns {Boolean}
*/
Function setLocalValue (name, value ){

If (window. localStorage) {// HTML 5, applicable to mobile phones
If (value! = Null & value! = 'Undefined '){
LocalStorage. setItem (name, value );
}

} Else {
If (value! = Null & value! = 'Undefined '){
Document. cookie = name + "=" + value;
}
}

Return true;
}


Wap page Programming Language

WAP can use WML and xhtm mp. These languages can be combined with scripting languages, such as ASP, JSP, and PHP.

WML (Wireless Markup Language-Wireless Markup Language ). It is a markup language inherited from HTML, but WML is based on XML, so it is stricter than HTML.
WML is used to create pages that can be displayed in the WAP browser. Pages written in WML are called DECKS. DECKS is constructed as a set of CARDS.
This descriptive language is the same as the HTML language we often hear. It belongs to the XML language family. The syntax of WML is the same as that of XML. WML is a subset of XML.
The content written in HTML can be read in IE, Netscape, and other browsers on our PC, WML language files are specially used for display on wireless terminal display devices such as mobile phones. They can also provide users with human-computer interaction interfaces, accept the query and other information entered by the user, and then return the final information he wants to obtain to the user.
-------------
Xhtml mp (XHTML Mobile Profile) is the markup language defined on WAP 2.0 ). Xhtml mp is a subset of XHTML. Before the emergence of xhtml mp, developers of WAP websites can only use WML and WML scripts to create WAP websites. At the same time, web developers are developing traditional websites with powerful HTML, CSS, and XHTML. Therefore, the goal of xhtml mp is to provide users with the best possible browsing experience on WAP and web.

-------------
You need to use xhtml mobile profile for websites with both a MOBILE phone and a computer. If you are using WAP 1.2 or 2.0, you can also use QuickWAP.
----------------
QuickWAP XML is an ActiveX component that is developed based on the WAP2.0 Protocol to assist ASP + xhtml mp programming WAP web page programs. It solves common problems encountered in WAP development, provides a complete solution, and fully supports Microsoft SQL Server2000 and Microsoft Access2000 databases, it is a rare auxiliary software for developing powerful dynamic WAP websites.

Using QuickWAP components to write WAP Web applications is not only stable, but also faster than ASP + XHTml ML web programs with the same functions, and the functions are easily extended, in addition, quick WAP + ASP + WML or QuickWAP + ASP + XHTML can be used together for WAP program development.
---------
3G is a new phase of network transmission. WAP can be used on mobile phones. WAP is divided into 1.2 and 2.0. The former uses the wml language, and the latter uses the xhtml mp language.

Self-taught mobile wap web pages are developed for java

Create a WAP page in WML. Add QQ654579780

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.