Notification

Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

20 sur 25 ont trouvé cela utile - Évaluez ce sujet

Web Development for Windows Phone

Windows Phone

March 22, 2012

Internet Explorer Mobile is based on Internet Explorer® 9 for the desktop; however, there are differences that web developers should consider. This topic describes some of these differences on a high level. For general information about designing mobile websites, see Designing Web Sites for Phone Browsers.

Internet Explorer Mobile supports the technologies and standards listed at the Internet Explorer 9 Guide for Developers topic, except for the items listed in the Unsupported Features for Internet Explorer Mobile section below.

Extra Features Supported in Internet Explorer Mobile 

The following features are supported in Internet Explorer Mobile and not in the desktop version of Internet Explorer 9.

  • GPS support for HTML5 geolocation. Windows Phone uses the location stack on the device and uses GPS if it is available.

  • Support for Viewport and its properties, as listed in the Viewport Settings section below.

  • Support for the CSS property –ms-text-size-adjust, as described in the Adjusting Text Size with Custom CSS section later in this topic.

Unsupported Features in Internet Explorer Mobile 

The following features are supported in the desktop version of Internet Explorer 9, and not in Internet Explorer Mobile.

  • InPrivate browsing

  • Tracking protection

  • Anti-phishing support

  • Backward compatibility for Internet Explorer 8 documents. Internet Explorer Mobile renders these documents in Internet Explorer 9 mode.

  • Cross-window communications, such as the ability to target a window by using script

  • Multi-stream HTML5 audio

  • Downloadable fonts such as EOT, TTF/OTF and WOFF fonts

  • CMYK image support

  • VBScript support

  • ActiveX support

  • Extensibility through browser helper objects, toolbars, and other related items

  • Active document support

  • Older web technology support, such as binary behaviors, HTCs, HTML+TIME, and VML

  • Full support for complex script languages in all document modes

  • Surrogate pair support

  • JIT support for Jscript

  • Certain <video> tag attributes and events. Internet Explorer Mobile does not support pre-loading audio or video files, and does not support automatic playback of audio or video files. For this reason, the preload and autoplay attributes are unsupported, and the canplay and canplaythrough events are unsupported.

The viewport is a rectangular region that controls how the document’s content is laid out and where text will wrap on the page. Internet Explorer Mobile supports the following viewport property and value paired settings.

Property name

Value

width

Sets the width of the viewport.

Can be any integer number or device-width.

The range is from 320 to 10,000.

The default value is 320.

height

Sets the height of the viewport.

Can be any integer number or device-height.

The range is from 480 to 10,000.

user-scalable

Indicates whether or not the user can scale the viewport, or in other words whether or not they can zoom in and out within content.

yes or no

The default value is 'yes'.

Note Note:

While available in some browsers, the minimum-scale, maximum-scale, and initial-scale properties are currently unsupported for Internet Explorer Mobile.

The following HTML code demonstrates how to add a <meta> tag for the viewport setting. In this example, the width is dynamically defined and the user will not be able to zoom in and out within content.

<meta name="viewport" content="width=device-width, user-scalable=no" />

Internet Explorer Mobile gives developers the option to control the webpage text size by setting the –ms-text-size-adjust CSS property. When the end user double-taps a page element, Internet Explorer Mobile scales the viewport to position the double-tapped element within the visible area of the screen. The corresponding text is also scaled to a legible size. Developers may choose to either control the adjusted text size or turn it off.

Note Note:

The –ms-text-size-adjust property will be ignored where the viewport tag is present.

The following example turns off text size adjustment for an HTML page:

html { -ms-text-size-adjust:none }

The following example turns on automatic text size adjustment for the body of an HTML page:

body { -ms-text-size-adjust:auto }

The following example adjusts the text size by 150 percent for a division of an HTML page:

div { -ms-text-size-adjust:150% }

Elements that are positioned using CSS fixed positioning behave differently on Internet Explorer Mobile compared to Internet Explorer 9. On the desktop, fixed elements are positioned relative to the client view of the browser window. This means that if an element is fixed in view at the bottom right-hand corner, it will always appear fixed in view at the bottom right-hand corner even when the end user scrolls the page up, down, left, or right. On the phone, fixed elements are positioned relative to the document itself and may not remain in view when the user scrolls the page. This means that if an element is fixed relative to the bottom right-hand corner of a document, the user will only see it when navigating to the bottom right-hand corner of the webpage.

Note Note:

When a user zooms in or out of a document, fixed elements will scale accordingly.

Unlike the desktop browser, Internet Explorer Mobile does not allow end users to download or install third-party plug-ins, such as ActiveX controls. Webpages should not prompt users to download plug-ins.

Cela vous a-t-il été utile ?
(1500 caractères restants)
Microsoft réalise une enquête en ligne pour recueillir votre opinion sur le site Web de MSDN. Si vous choisissez d’y participer, cette enquête en ligne vous sera présentée lorsque vous quitterez le site Web de MSDN.

Si vous souhaitez y participer,