I have a PHP file on my server that stores one string <div id="username">my.username</div>. The URL is http://intranet/text.php.
I would like to use some jQuery/Javascript to read this file and grab this element value.
I had tried to put something together but not sure how to open the file with JS.
'use strict';
var template = '<div id="username">replace-me</div>';
var output = document.createElement('div');
output.innerHTML = template;
output.querySelector('#username').innerHTML = 'get replaced';
console.log(output.innerHTML);