<!DOCTYPE html>
<html>
<body>
<script>
var gethttp = new XMLHttpRequest();
gethttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var load = JSON.parse(this.responseText);
//select from json
var x = load.nama;
var y = load.task;
// var y = load.pets[1].name;
//render and to html
document.querySelector("#nama").innerHTML = x;
document.querySelector("#alamat").innerHTML = y;
}
};
// gethttp.open("GET", "./numerologi/json.txt", true);
gethttp.open("GET", "seed/sprout", true);
gethttp.send();
</script>
<b id="nama"></b></br>
<b id="alamat"></b>
</body>
</html>
//htaccess for apacheRewriteEngine on
RewriteCond %{THE_REQUEST} /([^.]+)\.txt [NC]
RewriteRule ^ /%1 [NC,L,R]
RewriteCond %{REQUEST_FILENAME}.txt -f
RewriteRule ^ %{REQUEST_URI}.txt [NC,L]