2 Replies Latest reply on May 1, 2014 5:28 PM by Justin Rockwood

    TypeError: $0['api.ignoreDomain'] is undefined

    James Turley

      Hi all,

       

      I'm using the Javascript API (v8) to present datasets on the web. Part of the functionality is that clicking on a firm's name in a table will bring up a sort of pop-under type thing with relevant details on that particular firm (the details are pulled in with an Ajax call to another data source).

       

      I'm getting this error: TypeError: $0['api.ignoreDomain'] is undefined  at vqlweb.js (line 1293).

       

      onSelection = function(marksEvent) {
           if (!window.location.hash || (thisPage.current.getName() === window.location.hash.split('#')[1] + 'db')) { 
          return marksEvent.getMarksAsync().then(function(marks) {
            var dummySheet, sheet, sheets, _i, _len;
            if (marks[0] === !void 0) {
              return null;
            } else {
              sheets = viz.getWorkbook().getActiveSheet().getWorksheets();
              for (_i = 0, _len = sheets.length; _i < _len; _i++) {
                sheet = sheets[_i];
                if (sheet.getName() === "dummy") {
                  dummySheet = sheet;
                }
              }
              
              return dummySheet.getFiltersAsync().then(function(filters) {
                var ajaxResponse, detail, filter, firmFilter, firmName, _j, _len1;
                for (_j = 0, _len1 = filters.length; _j < _len1; _j++) {
                  filter = filters[_j];
                  if (filter.getAppliedValues().length === 1) {
                    firmFilter = filter;
                    
                  }
                }
                if (firmFilter.getAppliedValues().length < 2) {
                  firmName = firmFilter.getAppliedValues()[0]['formattedValue'];
                  if ((firmName !== "Null") && (firmName !== "Nulo")) {
                    ajaxResponse = $.ajax('http://url.redacted.com/foo.php?firm=' + encodeURIComponent(firmName.replace('*', '')), {
                      async: false,
                      dataType: 'jsonp',
                      contentType: 'application/json'
                    }).done(function(data, status, jqxhr) {
                         
                       detail = new Detail(new Firm(data), thisPage.viz, detailViz, firmDetail, glossary);
                    return detail.openDetail(detailPlaceholders, firmDetailLinkToChart);
                    });
                       
                    
                  }
                }
              });
            }
          });
           }
        };
      

       

       

      This is, clearly enough, horrible spaghetti code. It was, however,. working horrible spaghetti code on Friday (and possibly most of today). It is now mysteriously broken.

       

      I have seriously no idea how to proceed on this.

       

      UPDATE:

       

      The error appears to be  generated by Worksheet.getFiltersAsync()

       

      Any help on this would be much appreciated.