1 / 28

Internet Explorer 8 Compatibilità e standard

Internet Explorer 8 Compatibilità e standard. Pietro Brambati Developer Evangelist, Microsoft Blogs.msdn.com/ pietrobr. Agenda. Approcci alla compatibilità Document compatibility Concetti e Tecniche Meta Tag, Header Come determinare la Versione del browser Version Vector

Albert_Lan
Download Presentation

Internet Explorer 8 Compatibilità e standard

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Internet Explorer 8Compatibilitàe standard Pietro Brambati Developer Evangelist, Microsoft Blogs.msdn.com/pietrobr

  2. Agenda • Approcciallacompatibilità • Document compatibility • Concetti e Tecniche • Meta Tag, Header • Come determinare la Versione del browser • Version Vector • User Agent • Determinare la document compatibility dacodice

  3. Approcciallacompatibilità

  4. Cos’è la document compatibility • Internet Explorer 6: • Quirk Mode: (default), visualizzava come le versioniprecedenti • Standard Mode: segue gli standard • <!DOCTYPE> per la sceltadellamodalità • Internet Explorer 7: • Supporta due modalità • Necessariaunamigrazioneda un sitopensato per IE 6 • Internet Explorer 8: introduce la document compatibility • Controllo in IE8 qualemotoredi layout usare in base a come è fattoilsito • Quirk • IE 7 Standard • IE 8 Standard (nuova)

  5. Approcci alla compatibilità User Experience migliorata User Experience limitata Maggiorimpegno Minor sforzo per ilsito 3. Visualizzaresiti Intranet Compatibility Mode 1. sviluppare per IE8 Standards 2. Implementareil tag X-UA-Compatible 4. AffidarsiallaCompat. List 5. Affidarsiall’utente: Compat. Button

  6. 1. Sviluppare per IE8 Standard Mode • CSS 2.1 compliance • DOM: miglioramenti • HTML: miglioramenti • Acid2 Test compliance CSS 2.1 HTML ACID 2

  7. 2. Usare X-UA-Compatible Tag • Glisviluppatoridisiti web possono dire a IE8 per qualeversionedi IE ilsito è statosviluppato. Impostabile a livellodisito, a livellodipagina, includendo un tag Consigliato

  8. 3. Visualizzare i siti della Intranet in Compatibility Mode • Per default, IE8 visualizzaisitidella “Intranet” in IE7 mode • L’utente la puòdisabilitare • IT Pro puòusareuna Group Policy per visualizzare un sitodella intranet in IE8 mode

  9. 4. La “Compatibility View List" • Se unotraisitipiùgrandi ha riportatodeiproblemidicompatibiltità a Microsoft • IE8 visualizzeràilsito in compatibility mode

  10. 5. L’utente può premere il Compatibility Button • Vicino al bottonedi refresh • Simile a X-UA-Compatible tag (IE=EmulateIE7), ma la User-Agent String visualizza come browser IE7

  11. CompatibilityView • Sitoaggiuntoallalistadicompatibilità • Per rimuoveilsitodallalista • Content=“IE=EmulateIE8” • UA String Detection • Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 3.5.21022)

  12. Concetti e tecniche per la compatibilità

  13. Passi verso la compatibilità • Nelbreve: usareil tag IE=EmulateIE7 • Testareilvostrosito con IE8 • Virtual Machine • IE8 Developer Toolbar • Identificareglielementi del vostrositoche non funzionano in IE8, anche con il tag dicompatibilità • XSS Filter– Impedisce al JScriptdiessereeseguito • DEP/NX impedisce al codicedi non essereeseguito in areedimemoria non-executable • Il tool ACT (vedere link utili) tracciaalcuniproblemi • A lungotermine: sviluppare per IE8 in modalità Standard

  14. X-UA-Compatible • IIS 7: Windows Vista, Windows Server 2008

  15. X-UA-Compatible A livellodisito, aggiungere un HTTP Header: X-UA-Compatible: IE=EmulateIE7 <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <httpProtocol> <customHeaders> <clear /> <add name="X-UA-Compatible" value="IE=EmulateIE7"> </customHeaders> </httpProtocol> <system.webServer> </configuration>

  16. X-UA-Compatible A livellodipagina, aggiungere un tag subitodopo <head>: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN"> <html> <head> <title>My Web Page</title> <meta http-equiv="X-UA-Compatible" content="IE=Emulate7“ /> </head> <body> <p>Content goes here.</p> </body> </html>

  17. Esempi di DocType • Quirks <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Frameset//EN> • (o nessun DOCTYPE) • Standards <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Strict//EN>

  18. Version Vector • Funzionalitàspecificadi Internet Explorer • Chiavedi registry • Usato per elaborarecommenticondizionali in base alleversioni del browser <!—[if gte IE 5.5002]> <p>you are using IE 5 or higher</p> <![endif]-->

  19. Version Vector <!—[if IE 6]> <linkrel=“stylesheet” type=“text/css” href=“/stylesheets/ie6.css”/> <![endif]--> <!—[if IE 7]> <linkrel=“stylesheet” type=“text/css” href=“/stylesheets/ie7.css”/> <![endif]--> <!—[if gte IE 8]> <linkrel=“stylesheet” type=“text/css” href=“/stylesheets/standards.css”/> <![endif]-->

  20. La User Agent String • Rappresental’identità del Browser • Mandata al web server via HTTP header • Disponibile client-side via script javascript:alert(navigator.userAgent)

  21. Parsing della User Agent String function getInternetExplorerVersion() // Returns the version of Windows Internet Explorer or a -1 // (indicating the use of another browser). { varrv = -1; // Return value assumes failure. if (navigator.appName == 'Microsoft Internet Explorer') { varua = navigator.userAgent; var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); if (re.exec(ua) != null) rv = parseFloat( RegExp.$1 ); } return rv; }

  22. Controllare la versionedel browser function checkVersion() { varmsg = "You're not using IE."; varver = getInternetExplorerVersion(); if ( ver> -1 ) { if ( ver>= 8.0 ) msg = "You're using a recent copy of IE." else msg = "You should upgrade your copy of IE"; } alert( msg ); } http://msdn.microsoft.com/en-us/library/cc817582.aspx

  23. UA String vs. Version Vector • La User Agent String puòessereusata per qualsiasi browser • Il Version vector per emetterecodicedi markup in modocondizionale con IE • La User Agent String è usata per differenziare la logicadi business

  24. Come Determinare laDocumentCompatibility Mode • document.compatMode • Values • CSS1Compat – Standards Mode • BackCompat– Quirks Mode • da IE6: deprecato , usareoradocumentMode • document.documentMode • Values • 5 – Quirks • 7 – Strict • 8 – Internet Explorer 8 Standards Mode • In IE8 influenzata solo daX-UA-Compatible tag • Non dal DOCTYPE

  25. Determiare la Document Compatibility engine = null; if (window.navigator.appName == "Microsoft Internet Explorer") {    // Thisisan IE browser.    if (document.documentMode) // IE8   engine = document.documentMode;    else // IE 5-7    {       engine = 5; // Assume quirks mode unless if (document.compatMode)       {          if (document.compatMode == "CSS1Compat") engine = 7; // standards mode }}}

  26. Link utili • Defining Document Compatibility: Step-by-step instructions for meta tag placement • http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx • Internet Explorer 8 Compatibility Test Guide • http://msdn.microsoft.com/en-us/library/cc848857(VS.85).aspx • IE8 Compatibility – Meta tags, HTTP headers, User Agent Strings on from Mike Ormond's (DPE) Blog • http://blogs.msdn.com/mikeormond/archive/2008/09/25/ie-8-compatibility-meta-tags-http-headers-user-agent-strings-etc-etc.aspx • Application Compatibility Toolkit 5.0 with the IE Compatibility Test Tool • http://www.microsoft.com/downloads/details.aspx?familyid=24DA89E9-B581-47B0-B45E-492DD6DA2971&displaylang=en

  27. Link Utili • Internet Explorer Compatibility Center • http://msdn.com/iecompat • Internet Explorer Developer Center • http://msdn2.microsoft.com/en-us/ie/default.aspx • Internet Explorer 8 Readiness Toolkit • http://www.microsoft.com/windows/internet-explorer/beta/readiness/ • Internet Explorer 8 Home Page • http://www.microsoft.com/ie/ie8

  28. © 2009 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.

More Related