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
Next revisionBoth sides next revision
dev:client_coding:javascript_api [2017/11/12 19:53] – external edit 127.0.0.1dev: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);
 +</code>
 +
 +=== 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;
 +}
 </code> </code>
  
Line 314: Line 325:
     for (var j=0;j<notes.length;j++) {     for (var j=0;j<notes.length;j++) {
         var note = z.Items.get(notes[j]);         var note = z.Items.get(notes[j]);
-        var note_html = note.getNote;+        var note_html = note.getNote();
     }      } 
 </code> </code>
dev/client_coding/javascript_api.txt · Last modified: 2022/07/02 18:22 by dstillman