Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:client_coding:javascript_api [2022/07/02 18:18] – [Window Scope vs. Non-Window Scope] dstillmandev:client_coding:javascript_api [2022/07/02 18:22] (current) – [Executing the search] dstillman
Line 216: Line 216:
 s.addCondition('collection', 'is', collectionKey); // e.g., 'C72FDAP2' s.addCondition('collection', 'is', collectionKey); // e.g., 'C72FDAP2'
 s.addCondition('savedSearch', 'is', savedSearchKey); s.addCondition('savedSearch', 'is', savedSearchKey);
 +</code>
 +
 +=== Search by creator === 
 +
 +<code javascript>
 +var name = 'smith';
 +s.addCondition('creator', 'contains', name);
 </code> </code>
  
Line 236: Line 243:
 results: results:
  
-<code javascript>var results = await s.search();</code>+<code javascript>var itemIDs = await s.search();</code>
  
 This returns the item ids in the search as an array. The next thing to do is to get the Zotero items for the array of IDs: This returns the item ids in the search as an array. The next thing to do is to get the Zotero items for the array of IDs:
  
-<code javascript>var items = await Zotero.Items.getAsync(results);</code>+<code javascript>var items = await Zotero.Items.getAsync(itemIDs);</code>
  
 ==== Managing citations and bibliographies ==== ==== Managing citations and bibliographies ====
dev/client_coding/javascript_api.1656800283.txt.gz · Last modified: 2022/07/02 18:18 by dstillman