Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
dev:client_coding:javascript_api [2018/09/09 05:08] – [API Methods] zuphilip | dev:client_coding:javascript_api [2019/01/22 00:34] – [Zotero JavaScript API] dstillman | ||
---|---|---|---|
Line 7: | Line 7: | ||
====== Zotero JavaScript API ====== | ====== Zotero JavaScript API ====== | ||
- | Whereas Zotero' | + | Whereas Zotero' |
Note that the (mostly user-contributed) documentation of the JavaScript API is not comprehensive. If you use the JavaScript API in ways beyond what's described here, please consider expanding this wiki page. | Note that the (mostly user-contributed) documentation of the JavaScript API is not comprehensive. If you use the JavaScript API in ways beyond what's described here, please consider expanding this wiki page. | ||
Line 341: | Line 341: | ||
the Zotero database. | the Zotero database. | ||
- | <code javascript> | + | <code javascript> |
+ | |||
+ | ==== Set two items as related to each other ==== | ||
+ | |||
+ | Given two items '' | ||
+ | to each other by using the '' | ||
+ | |||
+ | <code javascript> | ||
+ | await itemA.saveTx(); | ||
+ | itemB.addRelatedItem(itemA); | ||
+ | await itemB.saveTx(); | ||
- | This returns a list of items just like in the search examples. | ||
==== Get an Item's Attachments === | ==== Get an Item's Attachments === |