added check for the element
diff --git a/src/main/resources/generators/javascript.html b/src/main/resources/generators/javascript.html
index 6c30293..03c8e40 100755
--- a/src/main/resources/generators/javascript.html
+++ b/src/main/resources/generators/javascript.html
@@ -24,7 +24,8 @@
xhr.timeout = 10000;
xhr.onload = function () {
if (xhr.status >= 200 && xhr.status < 300) {
- document.getElementById('${uniqueId}').innerHTML = xhr.responseText;
+ var elemId = document.getElementById('${uniqueId}');
+ if (elemId) elemId.innerHTML = xhr.responseText;
}
};
xhr.open('GET', encodeURI("${url}"));