$.ajax({ dataType: "text", url: "closed.txt", cache: false, success: function (value) { if (value !== "true") return; $('#closed').html( /*html*/ ` `); } });