From 7620e3ad01492521ddcc21ca92d6c5f1034bdb3a Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Fri, 23 Nov 2012 11:21:31 +0200 Subject: Set bootstrap error using innerHTML instead of document.write (#9735) * Also remove the testbench hook so waitForVaadin can continue * Add automatic test Change-Id: I6a6e53f23af9746f33977dfdb3768870956943f2 --- WebContent/VAADIN/vaadinBootstrap.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'WebContent') diff --git a/WebContent/VAADIN/vaadinBootstrap.js b/WebContent/VAADIN/vaadinBootstrap.js index 8c6e80a14f..c4617df25c 100644 --- a/WebContent/VAADIN/vaadinBootstrap.js +++ b/WebContent/VAADIN/vaadinBootstrap.js @@ -105,9 +105,10 @@ r.open('POST', url, true); r.onreadystatechange = function (aEvt) { if (r.readyState == 4) { + var text = r.responseText; if (r.status == 200){ - log("Got root config response", r.responseText); - var updatedConfig = JSON.parse(r.responseText); + log("Got root config response", text); + var updatedConfig = JSON.parse(text); // Copy new properties to the config object for (var property in updatedConfig) { @@ -118,10 +119,16 @@ // Try bootstrapping again, this time without fetching missing info bootstrapApp(false); - } else if (r.status == 500) { - document.write(r.responseText); } else { - log('Error', r.statusText); + log('Error', r.statusText, text); + + //Let TB waitForVaadin work again + delete window.vaadin.clients[testbenchId]; + + // Show the error in the app's div + var appDiv = document.getElementById(appId); + appDiv.innerHTML = text; + appDiv.style['overflow'] = 'auto'; } } }; -- cgit v1.2.3