Places API Reference

Contents

UI API

 
nokia

Data API

 
nokia

jsMotif

 
jsMotif

Namespace jsMotif.selector

Namespace Summary

This namespace defines a selector for JSON objects, which is a simplified Xpath for safe JSON object data selection. The functions in this namespace are used within jsMotif.Template.

Method Summary

getData (path, defaultValue)
This function retrieves data from a JSON object, using the provided path.
resolveCondition (selector)
This function resolves a conditional path.

Method Detail

getData (path, defaultValue)
This function retrieves data from a JSON object, using the provided path.
Examples:
getData.call(jsonObject,'path1.path2[3]','default text');
Parameters:
{String} path
The path to data within the JSON object; may contain array selectors
{Object} defaultValue
The default value to return when the path finds nothing
resolveCondition (selector)
This function resolves a conditional path.
Examples:
resolveCondition.call(jsonObj,'path1.inner1');
resolveCondition.call(jsonObj,'path1.inner2=="some text");
Parameters:
{String} selector
A selector or a conditional path
Returns:
Boolean value indicating if the condition is met

Copyright © 2011 Nokia. All rights reserved. Terms and Conditions