Programming4us
         
 
 
Programming

Programming the Mobile Web : JavaScript Mobile - Supported Technologies

12/24/2010 2:40:36 PM
We are going to test JavaScript compatibility in the following pages, but making JavaScript work requires more than just support for the language. There are many technologies (or APIs) that are bundled with JavaScript, but they are optional and will not work on all devices.

1. Document Object Model

DOM is a set of conventions for manipulating, browsing, and editing XML and HTML documents using a set of API conventions that may be implemented in many languages. In fact, although many developers think that DOM is a JavaScript thing, this is wrong. There are DOM APIs for PHP, .NET, Java, and many other languages.

Even if you’ve never heard about DOM, odds are good that you’ve used it. If you’ve used the well-known document.getElementById function, for example, you were using DOM.

Today, DOM is a W3C specification. The most compatible versions for web use are the DOM Level 2 Core specification (DOM2CORE) and the subspecification DOM Level 2 HTML (DOM2HTML) for HTML and XHTML documents.

With DOM, we can browse the XHTML document structure and make changes and additions dynamically from JavaScript without refreshing the page.

A mobile browser can be JavaScript-compatible but without DOM functionality. There are also some browsers that allow us to browse the document tree but not to modify it on the fly.

2. Ajax

Ajax, originally an acronym of Asynchronous JavaScript and XML, is a technique that involves making asynchronous server requests without refreshing the page, interrupting the user’s activity, changing the browser’s history, or losing global state variables.


Note:

Why did I say “originally an acronym”? Today the term Ajax is used in a more general way to define interactive Web 2.0 applications that use asynchronous requests to the server, but may or may not be written in XML. I even hear a lot about Ajax in dynamic websites using the jQuery UI, ExtJS, or other rich control libraries that don’t actually make background requests to the server.


The magic behind Ajax is called XMLHttpRequest; it is a native JavaScript object available in compatible devices that was based on an ActiveX object created by Microsoft in Internet Explorer 5.0.

3. JSON

JavaScript Object Notation (best known as JSON) is a lightweight data interchange format known to be compatible with almost every language in common use. It is sometimes used in JavaScript as a replacement for other transport formats, like XML.

JSON can be used in Ajax requests. We will talk about differences in the mobile browsers’ implementations in a while.

4. HTML 5 APIs

With the upcoming HTML 5 standard, JavaScript will support some new APIs for client scripting and document work. Mobile browsers are already adopting some of these new APIs, even though the standard is still in discussion.

Some of the APIs we are going to discuss in this article are those for:

  • Offline applications

  • Client storage

  • Canvas drawing

  • Workers

  • Geolocation (available as another W3C standard)

5. Platform Extensions

There are other extensions available for web applications on some devices, and many other JavaScript APIs are supported in installed applications . These JavaScript APIs can include support for:

  • Messaging

  • Address book management

  • Geolocation

  • Gallery

  • Camera

  • Calendar

  • Device status information

  • Native menus

Other -----------------
- Security in Cloud Computing (part 4) - Audit and Compliance
- Security in Cloud Computing (part 3)
- Security in Cloud Computing (part 2) - Identity and Access Management
- Security in Cloud Computing (part 1) - Data Security and Storage
- Cloud Security and Privacy : Analyst Predictions
- CSS for Mobile Browsers : WebKit Extensions (part 2) - Border Image
- CSS for Mobile Browsers : WebKit Extensions (part 1) - Text Stroke and Fill
- jQuery 1.3 : Working with numeric form data (part 9) - The finished code
- jQuery 1.3 : Working with numeric form data (part 8) - Editing shipping information
- jQuery 1.3 : Working with numeric form data (part 7) - Deleting items
- jQuery 1.3 : Working with numeric form data (part 6) - Finishing touches
- jQuery 1.3 : Working with numeric form data (part 5)
- jQuery 1.3 : Working with numeric form data (part 4) - Dealing with decimal places
- jQuery 1.3 : Working with numeric form data (part 3) - Parsing and formatting currency
- jQuery 1.3 : Working with numeric form data (part 2)
- jQuery 1.3 : Working with numeric form data (part 1) - Shopping cart table structure
- The Art of SEO : Controlling Content with Cookies and Session IDs
- iPad SDK : New Graphics Functionality - We Are All Tool Users (part 5) - The Freehand Tool
- iPad SDK : New Graphics Functionality - We Are All Tool Users (part 4) - The Ellipse and Rectangle Tools
- iPad SDK : New Graphics Functionality - We Are All Tool Users (part 3) - The Line Tool
 
 
Most View
- Windows Server 2008 : Configuring Terminal Services Clients
- SharePoint 2010 : Use the Datasheet View to Add, Edit, or Delete Items and Files
- Setting Up a Full-Text Index (part 4) - Using the Full-Text Indexing Wizard to Build Full-Text Indexes and Catalogs
- SharePoint 2010 : Specify How Folders Will Be Used in a View
- Building Android Apps : Animation - Sliding Home
- Windows Phone 7 : Synching Notes to the Web
- Scripting Windows 7 with WSH : Programming the Windows Management Instrumentation Service
- Windows Server 2008 : Perform an Unscheduled Backup of Critical Volumes of a Domain Controller by Using the Windows Interface
- Working with the SharePoint 2010 Management Shell (part 6)
- SharePoint 2010 : Choose a Column Type (part 1) - Single Line of Text
Top 10
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 3) - Configuring Recipient Filtering
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 2)
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 1)
- Implementing Edge Services for an Exchange Server 2007 Environment : Installing and Configuring the Edge Transport Server Components
- What's New in SharePoint 2013 (part 7) - BCS
- What's New in SharePoint 2013 (part 6) - SEARCH
- What's New in SharePoint 2013 (part 6) - WEB CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 5) - ENTERPRISE CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 4) - WORKFLOWS
- What's New in SharePoint 2013 (part 3) - REMOTE EVENTS