diff --git a/ajax-requests/js/jsonCap.js b/ajax-requests/js/jsonCap.js index f70fb22..de57652 100644 --- a/ajax-requests/js/jsonCap.js +++ b/ajax-requests/js/jsonCap.js @@ -3,7 +3,9 @@ console.log('jsonCap.js has loaded...'); function captureJSON() { var xhr = new XMLHttpRequest(); xhr.onload = function() { - var div = document.getElementById('capturedJSON'), + var btn = document.getElementsByTag('button')[0], + btnTxt = btn.textContent, + div = document.getElementById('capturedJSON'), content = '', check = div.innerHTML == content; if (check) { @@ -20,11 +22,13 @@ function captureJSON() { content += '