File tree Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ function insertAndStyleText(documentId, text) {
144144function readFirstParagraph ( documentId ) {
145145 try {
146146 // Get the document using document ID
147- const document = Docs . Documents . get ( { 'includeTabsContent' : true } , documentId ) ;
147+ const document = Docs . Documents . get ( documentId , { 'includeTabsContent' : true } ) ;
148148 const firstTab = document . tabs [ 0 ] ;
149149 const bodyElements = firstTab . documentTab . body . content ;
150150 for ( let i = 0 ; i < bodyElements . length ; i ++ ) {
Original file line number Diff line number Diff line change 2121 */
2222function printDocTitle ( ) {
2323 const documentId = '195j9eDD3ccgjQRttHhJPymLJUCOUjs-jmwTrekvdjFE' ;
24- try {
25- // Get the document using document id
26- const doc = Docs . Documents . get ( { 'includeTabsContent' : true } , documentId ) ;
27- // Log the title of document.
28- console . log ( 'The title of the doc is: %s' , doc . title ) ;
29- } catch ( err ) {
30- // TODO (developer) - Handle exception from Docs API
31- console . log ( 'Failed to found document with an error %s' , err . message ) ;
32- }
24+ const doc = Docs . Documents . get ( documentId , { 'includeTabsContent' : true } ) ;
25+ console . log ( `The title of the doc is: ${ doc . title } ` ) ;
3326}
3427// [END docs_quickstart]
You can’t perform that action at this time.
0 commit comments