Introduction to WebKit DOM Programming Topics
JavaScript is a powerful interpreted scripting language designed for embedding into web-based applications. You can use the JavaScript Document Object Model (DOM) in Safari and the WebKit framework to help provide dynamic content to your users, whether you are designing web content, Dashboard widgets, or Cocoa applications.
Who Should Read This Document?
This document is designed for a number of different audiences:
If you are a web content developer—developing web sites and embedded JavaScript applications—you should read about Safari’s JavaScript support and how scripts operate within WebKit-based applications.
If you are a Cocoa and WebKit developer, you should read about how to integrate JavaScript into your WebKit views and how to enhance your user experience in doing so.
If you are a Dashboard developer, you should read about integrating JavaScript into your widgets to provide a better user experience and more advanced features to your users.
Organization of This Document
The topic contains the following articles:
“About JavaScript and the DOM” describes the JavaScript language and its implementation in Safari and WebKit.
“Using the Document Object Model From JavaScript” discusses the Document Object Model and how to use it from JavaScript.
“Using the Canvas” describes the canvas object, a critical part of Dashboard but also useful within other WebKit applications.
“Using the Pasteboard From JavaScript” describes how to implement copy and paste functionality within embedded JavaScript applications.
“Using Drag and Drop From JavaScript” describes how to use OS X drag and drop functionality from within Safari and WebKit windows.
“Using XMLHttpRequest Objects” describes how to request data from network resources using the
XMLHttpRequestobject.“Sending Notifications” describes how to send notifications to Notification Center from your web content in OS X Mountain Lion.
“Calling Objective-C Methods From JavaScript” describes how to use Objective-C in the JavaScript scripting environment, either within a WebKit object or by using a custom browser plug-in.
See Also
Safari HTML Reference provides descriptions of HTML tags, attributes, and other markup.
Safari CSS Reference provides descriptions of CSS properties and constants.
Safari Web Content Guide provides information about designing web content for iPhone.
Safari HTML5 Canvas Guide provides information about the
<canvas>HTML5 element.Dashboard Programming Topics provides information on the technologies available to you when creating a Dashboard widget. Additional Dashboard documents and sample code can be found in the Reference Library > Apple Applications > Dashboard.
The Reference Library > Apple Applications > Safari section of the ADC Reference Library provides useful information on WebKit, the technology that provides Apple’s JavaScript runtime.
© 2004, 2013 Apple Inc. All Rights Reserved. (Last updated: 2013-03-14)