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 [2017/11/12 19:53] – external edit 127.0.0.1 | dev:client_coding:javascript_api [2018/09/08 17:16] – [API Methods] new subsubsection about creating a new collection zuphilip | ||
---|---|---|---|
Line 199: | Line 199: | ||
// or you can obtain an array of itemIDs instead: | // or you can obtain an array of itemIDs instead: | ||
var itemids = collection.getChildItems(true); | var itemids = collection.getChildItems(true); | ||
+ | </ | ||
+ | |||
+ | === Create a New Collection in a function === | ||
+ | |||
+ | <code javascript> | ||
+ | async function createCollection(name) { | ||
+ | let collection = new Zotero.Collection(); | ||
+ | collection.name = name; | ||
+ | var collectionID = await collection.saveTx(); | ||
+ | return collectionID; | ||
+ | } | ||
</ | </ | ||
Line 314: | Line 325: | ||
for (var j=0; | for (var j=0; | ||
var note = z.Items.get(notes[j]); | var note = z.Items.get(notes[j]); | ||
- | var note_html = note.getNote; | + | var note_html = note.getNote(); |
} | } | ||
</ | </ |