I have a simple html in file and I want to ghetto it in a variable to use, I did the get like this:
let popup = '';
$.get( "popup.html", function( data ) {
// the contents is now in the variable data
console.log("data"+data);
popup = data;
});
console.log("popup"+popup);
But it is not saving in popup, the log is:
popup
(index):247 data<p style="font-weight: bold;font-size: 16px" id="nome">a</p>
<div class="dropdown-divider w-50 mx-auto "></div>
<p id="endereco">c</p>
<p id="tel">dc</p>
<p id="email">ca</p>