Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision Next revision | Previous revision | ||
dev:client_coding:javascript_api [2020/10/17 21:10]– [API Methods]dstillman | dev:client_coding:javascript_api [2024/08/21 03:55](current)188BET靠谱吗– [Zotero JavaScript API]dstillman | ||
---|---|---|---|
Line 3: | Line 3: | ||
188BET靠谱吗Whereas Zotero' |
188BET靠谱吗Whereas Zotero' |
||
- | Note thatthe (mostly user-contributed) |
+ | Note thatthisdocumentation 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 page188金宝慱亚洲F1or suggesting changes in the forums. |
- | + | ||
188BET靠谱吗===== Running Ad Hoc JavaScript in Zotero ===== | 188BET靠谱吗===== Running Ad Hoc JavaScript in Zotero ===== | ||
Line 36: | Line 34: | ||
Non-window scope applies to lower-level code that doesn' |
Non-window scope applies to lower-level code that doesn' |
||
- | Overlays and windows |
+ | Windows |
- | 188BET靠谱吗To access Zotero functionality from your own extension, you will need access to the core '' |
+ | 188BET靠谱吗To access Zotero functionality from your own extension, you will need access to the core '' |
|
|
||
Line 216: | Line 214: | ||
s.addCondition(' |
s.addCondition(' |
||
s.addCondition(' |
s.addCondition(' |
||
+ |
code> |
||
+ | |||
+ | === Search by creator === | ||
+ | |||
+ |
|
||
+ | var name = ' |
||
+ | s.addCondition(' |
||
code> |
code> |
||
Line 236: | Line 241: | ||
results: | results: | ||
- |
|
+ |
|
This returns the item ids in the search as an array.188BET靠谱吗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.188BET靠谱吗The next thing to do is to get the Zotero items for the array of IDs: | ||
- |
|
+ |
|
==== Managing citations and bibliographies ==== | ==== Managing citations and bibliographies ==== | ||
Line 340: | Line 345: | ||
return fulltext; | return fulltext; | ||
code> |
code> |
||
+ | |||
+ | ==== File I/O ==== | ||
+ | |||
+ | === Getting the contents of a file === | ||
+ | |||
+ |
|
||
+ | var path = '/ |
||
+ | 188BET靠谱吗var data = await Zotero.File.getContentsAsync(path); |
||
+ |
code> |
||
+ | |||
+ | === Saving data to a file === | ||
+ | |||
+ |
|
||
+ | var path = '/ |
||
+ | var data = "This is some text."; |
||
+ | 188BET靠谱吗await Zotero.File.putContentsAsync(path, |
||
+ |
code> |
||
+ | |||
==== To Do === | ==== To Do === |