From 961feedf4eb73c5f5cda8237749cb1b751740470 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 22 Feb 2013 14:17:14 +0100 Subject: [PATCH] Show an error message if tab loading fails --- src/root/common.tt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/root/common.tt b/src/root/common.tt index ad935285..4497cbe4 100644 --- a/src/root/common.tt +++ b/src/root/common.tt @@ -461,7 +461,11 @@ BLOCK makeLazyTab %] var pattern = /#.+/gi; var id = e.target.toString().match(pattern)[0]; if (id == "#[% tabName %]") { - $('#[% tabName %]').load("[% uri %]"); + $('#[% tabName %]').load("[% uri %]", function(response, status, xhr) { + if (status == "error") { + $('#[% tabName %]').html("
Error loading tab: " + xhr.status + " " + xhr.statusText + "
"); + } + }); } }); });