ID如何返回其他功能?

时间:2015-02-07 02:39:11

标签: javascript google-apps-script google-picker

如何为其他功能返回ID?

function pickerCallback(data) {
  var action = data[google.picker.Response.ACTION];

  if (action == google.picker.Action.PICKED) {
    var doc = data[google.picker.Response.DOCUMENTS][0];
    **var id = doc[google.picker.Document.ID];**
    var url = doc[google.picker.Document.URL];
    var title = doc[google.picker.Document.NAME];
      google.script.run.doSomething(id);

    alert(id);
    document.getElementById('result').innerHTML =
      '<b>You chose:</b><br>Name: <a href="' + url + '">' + title + '</a><br>ID: ' + id;
    } else if (action == google.picker.Action.CANCEL) {
      document.getElementById('result').innerHTML = 'Picker canceled.';
   }   }

0 个答案:

没有答案