/ Published in: JavaScript
This code works for me without requiring any includes, plugins, or service packs. It should also integrate seamlessly with jquery. If needing to perform this process more than once on a page, make sure namedListItem variable is unique for each case (use different names for that page-scoped variable in each case).
For caml queries, wrap Query tag in View tag.
For lookup fields use .get_lookupValue() property syntax. For example...
<pre>topNavSection[enm] = oListItem.get_item('Section').get_lookupValue();</pre>
For caml queries, wrap Query tag in View tag.
For lookup fields use .get_lookupValue() property syntax. For example...
<pre>topNavSection[enm] = oListItem.get_item('Section').get_lookupValue();</pre>