Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

197
Vistas
CORB from Vanilla JS getJSONP to Google Apps Script

I have a simple set up in which I populate data on my HTML page by accessing data in a Google Sheet.

This works perfectly well in Chrome, but in Edge I get a CORB error in the console. I'm using Google Apps Script and Vanilla JS. My Google Apps Script is

function doGet(request) {
  var res = getData();
  return ContentService.createTextOutput(
    request.parameters.prefix + '(' + JSON.stringify(res) + ')')
    .setMimeType(ContentService.MimeType.JAVASCRIPT);
}
 
//GET DATA FROM GOOGLE SHEET AND RETURN AS AN ARRAY
function getData(){
  var spreadSheetId = "mySpreadsheetID";
  var dataRange     = "Projects!A2:J50";
 
  var range   = GoogleSheetsAPI.Spreadsheets.Values.get(spreadSheetId,dataRange);
  return range.values;
}

and my JavaScript is:

var gScriptURL = "https://script.google.com/a/macros/blah/s/blahblahblah/exec?prefix=console.log&dataType=json&callback=?";

var loadJSONP = (function(){
  var unique = 0;
  return function(url, callback, context) {

    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src = url;

    window[name] = function(data){
      callback.call((context || window), data);
      document.getElementsByTagName("head")[0].removeChild(script);
      script = null;
      delete window[name];
    };

    document.getElementsByTagName("head")[0].appendChild(script);
  };
})();

function getData(){
    loadJSONP(
    gScriptURL,
    function(data) {
      console.log(data);
    }
  );
}

In Google Chrome, I get an array dumped to the console, in Edge I get:

Cross-Origin Read Blocking (CORB) blocked cross-origin response https://url.com/login/login.htm?fromURI=blahblah with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.

Which seems to have issues with MIME type text/html, but I'm explicitly requesting json. Or am I!?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda