我已经成功编写了一个脚本并将其嵌入到我的 Google 站点中。该脚本在 Chrome 和 Safari 中运行良好,但我在 IE 中收到“此内容无法在框架中显示”错误,即使我已使用 Google 的说明和 Apps Script Gadget 添加了该脚本。查看我的代码,该代码是否有特定部分导致 IE 出现安全问题并拒绝显示它?该代码将电子表格加载到带有选项卡的图表中(这是一个很大的电子表格,因此我将其细分为选项卡),然后用户可以根据几个不同的字段进行过滤。有解决方法吗?
function doGet(e) {
var app = UiApp.createApplication();
var ssID = '0AhiXAz5qhL4TdERkNFJndkVXd1A3T0xYdHlnMkp3U2c';
var ss = SpreadsheetApp.openById(ssID);
var sheet = ss.getSheets()[0];
var dataRange = sheet.getDataRange();
var numRows = dataRange.getNumRows();
var numCols = dataRange.getNumColumns();
var dataTable = sheet.getRange(1, 4, numRows, numCols - 3).getDataTable();
// Filters
var locationFilter = Charts.newCategoryFilter()
.setDataTable(dataTable)
.setFilterColumnLabel('Where was your role located?')
.setAllowMultiple(true)
.setSortValues(true)
.setLabelStacking(Charts.Orientation.VERTICAL)
.setCaption('Choose a location')
.setSortValues(true)
.build();
var functionFilter = Charts.newCategoryFilter()
.setDataTable(dataTable)
.setFilterColumnLabel('In what function was your role?')
.setAllowMultiple(true)
.setSortValues(true)
.setLabelStacking(Charts.Orientation.VERTICAL)
.setCaption('Choose a function')
.setSortValues(true)
.build();
var titleFilter = Charts.newCategoryFilter()
.setDataTable(dataTable)
.setFilterColumnLabel('What was the role title?')
.setAllowMultiple(true)
.setSortValues(true)
.setLabelStacking(Charts.Orientation.VERTICAL)
.setCaption('Choose a title')
.setSortValues(true)
.build();
var numberFilter = Charts.newCategoryFilter()
.setDataTable(dataTable)
.setFilterColumnLabel('Which placement was the role?')
.setAllowMultiple(true)
.setSortValues(true)
.setLabelStacking(Charts.Orientation.VERTICAL)
.setCaption('Choose a placement number')
.setSortValues(true)
.build();
// Build individual tab charts
// Tab 1: Role Specific
var dataViewDef1 = Charts.newDataViewDefinition().setColumns([0, 1, 2, 3, 4, 5, 6, 7, 8]);
var chart1 = Charts.newTableChart().setDataTable(dataTable).setOption('width', '100%').setOption('height', '100%').setDataViewDefinition(dataViewDef1).build();
// Tab 2: Training
var dataViewDef2 = Charts.newDataViewDefinition().setColumns([0, 1, 2, 3, 9, 10, 11]);
var chart2 = Charts.newTableChart().setDataTable(dataTable).setOption('width', '100%').setOption('height', '100%').setDataViewDefinition(dataViewDef2).build();
// Tab 3: Line Manager
var dataViewDef3 = Charts.newDataViewDefinition().setColumns([0, 1, 2, 3, 12, 13]);
var chart3 = Charts.newTableChart().setDataTable(dataTable).setOption('width', '100%').setOption('height', '100%').setDataViewDefinition(dataViewDef3).build();
// Tab 4: Development Tools
var dataViewDef4 = Charts.newDataViewDefinition().setColumns([0, 1, 2, 3, 14, 15]);
var chart4 = Charts.newTableChart().setDataTable(dataTable).setOption('width', '100%').setOption('height', '100%').setDataViewDefinition(dataViewDef4).build();
// Tab 5: Culture, Visas, and Moves
var dataViewDef5 = Charts.newDataViewDefinition().setColumns([0, 1, 2, 3, 16, 17]);
var chart5 = Charts.newTableChart().setDataTable(dataTable).setOption('width', '100%').setOption('height', '100%').setDataViewDefinition(dataViewDef5).build();
// Create GUI
var tabPanel = app.createTabPanel();
var vpanel = app.createVerticalPanel().setSpacing(10);
var scroll = app.createScrollPanel().setId('scroll').setSize('100%', '100%');
tabPanel.add(chart1, 'Role Specific').add(chart2, 'Training').add(chart3, 'Line Manager').add(chart4, 'Development').add(chart5, 'Culture');
tabPanel.selectTab(0);
vpanel.add(locationFilter).add(functionFilter).add(titleFilter).add(numberFilter).add(tabPanel);
var dashboard = Charts.newDashboardPanel().setDataTable(dataTable).bind([locationFilter, functionFilter, titleFilter, numberFilter], [chart1, chart2, chart3, chart4, chart5]).build();
dashboard.add(vpanel);
app.add(dashboard);
return app;
}