发表于 & 归档在 Web.

介绍

Safari运行在多种操作系统和设备上,所有的Safari版本-包括桌面版和iPhone OS版-都是用相同的WebKid内核,此外为桌面版编写的网页内容无需修改就可以在iPhone OS上显示,存在某些差异,但基本上是兼容的,接着你可以为iPhone OS定制你的网页,以适合用户访问,如确保你的网页能在Wi-Fi,3G和EDGE网络下使用,正确的渲染和缩放,使用iPhone OS支持的媒体,对于其他设备如iPad也只需少量的修改,最后你就可以创建兼容各个平台,如同本地程序效果的Web应用了。

桌面版本的Safari支持Mac OS X和Windows,是全功能的浏览器,支持行业标准,并包含很多WebKit扩展,此外还包含开发工具,用于分析测试,调试网站和Web应用程序

iPhone OS版本的Safari,是用于iPhone, iPod touch, iPad的浏览器程序,同样是全功能的浏览器,运行在高分辨率屏幕的手持设备上,是特别用于支持触摸输入,多点触控交互的Safari版本,同时他支持横向和纵向渲染网页,还包含一些内置功能,如:PDF预览,视频播放,以及通过链接拨打电话,发送邮件,打开地图和YouTube程序的功能。

WebKit是一个开源项目,是Mac OS X中的基本框架库,用于程序员在他们的Cocoa程序中嵌入浏览器,支持通过JavaScript或Objective-C接口访问网页文档对象模型(DOM) ,Dashboard, Mail, 以及很多其他Mac OS X 程序都是使用WebKit嵌入浏览器,iPhone OS中,你可以使用UIKit的 UIWebView 类嵌入浏览器到本地应用程序

此外为了增强浏览器的功能,WebKit支持对HTML, CSS和JavaScript的扩展,如Safari上的扩展,包括CSS动画变换,Javascript数据库支持,iPhone OS版本的Safari包括多点触控事件支持,有些扩展Safari各个平台都支持,有些不是,查阅参考文档可以了解这些可用的功能

本文档还包括如何对不同平台分开创建网页内容,这样可以使不同浏览器下有合适自己平台的呈现效果,本文档还包括iPhone OS下构建web应用的基础介绍

iPhone OS Note: Safari for iPhone OS 在不同设备下有相同的行为,除了一些link只有iPhone支持外,参阅: Apple URL Scheme Reference 了解链接在不同设备下的行为,在iPad下一些HTML5的多媒体对象具有与桌面版相似的效果,参阅 Safari HTML5 Audio and Video Guide 了解iPad上的区别.

哪些人需要阅读本文档

下列情况值得阅读本文档:希望自己的web内容在桌面环境和iPhone OS下都有很好的效果,计划编写iPhone OS特色的网页,使用iPhone OS特有的样式,在网页内容中使用iPhone应用程序链接,为不同平台定制Web…

iPhone OS Note: Also read iPhone Human Interface Guidelines for Web Applications, a companion document, which describes how Safari on iPhone OS behaves and contains metrics and tips on designing user interfaces for iPhone OS. Understanding how Safari on iPhone OS presents web content to the user and how the user can zoom, pan, and double-tap on your webpages are prerequisites for reading this document.

本文档的结构

下面的章节需要首先阅读:

This chapter covers the first steps you need to follow to optimize web content for Safari:

  • “Optimizing Web Content” describes how to detect Safari on different platforms and use conditional Cascading Style Sheets (CSS) so that you can begin optimizing web content for iPhone OS.

These chapters describe different ways to optimize web content for iPhone OS:

This chapter describes how to create video content for multiple platforms:

  • “Creating Video” explains how to create video content for playback on iPhone OS in general, including video content embedded in your webpages.

This chapter covers information on how to store data locally:

This chapter covers information on how to debug web content:

  • “Debugging” describes the Safari on iPhone OS console which you use to help test and debug your webpages.

If you are new to web development, read these appendixes that provide introductions to HTML and CSS:

  • “HTML Basics” provides an overview on how to create structured HTML web content.
  • “CSS Basics” describes how to add style sheets to existing HTML web content.

See Also

There are a variety of other resources for Safari web content developers in the ADC Reference Library.

If you are creating an iPhone OS web application, then you should also read:

If you want to learn more about visual effects, then you should read:

  • Safari CSS Visual Effects Guide, which describes how to use the CSS visual effects properties including the transition, animation, and transforms properties. It also covers the JavaScript APIs for handling visual effects events.

If you want to embed video and audio in your webpages read:

If you want to learn more about JavaScript multi-touch event support, then you should read:

  • Safari DOM Additions Reference, which describes DOM extensions including touch event classes that you use to handle multi-touch gestures in JavaScript on iPhone OS.

If you want to learn more about JavaScript database support, then you should read:

If you want to use the JavaScript media APIs, then you should read:

If you want to learn more about what HyperText Markup Language (HTML) tags and Cascading Style Sheets (CSS) properties are supported in Safari, then read:

  • Safari HTML Reference, which describes the HTML elements and attributes supported by various Safari and WebKit applications.
  • Safari CSS Reference, which describes the CSS properties supported by various Safari and WebKit applications.

If you are using JavaScript and want access to the DOM or use the canvas object, then read:

If you are developing web content for Safari on the desktop and iPhone OS, then you should read:

If you want to embed a browser in your iPhone OS application, then read:

  • UIWebView Class Reference for a description of the UIWebView class.

If you want to learn more about WebKit or contribute to the open source project, then go to The WebKit Open Source Project.

If you want to read the WebKit W3C proposals, then go to: http://www.webkit.org/specs.

发表评论

电子邮件地址不会被公开。 必填项已用*标注


八 + 6 =

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>