I'm building a website, and I need to access a file called friends.txt
and get the first element.
I then use it in the folder name to display some pictures. The problem is that jquery.get
seems to have security restrictions and I can only get it to work in Internet Explorer. Should I do something else to read a server side file?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
$.get("friends.txt", function(data){
var text = data.split("/");
var p1 = text[0];
var x = document.createElement("IMG");
x.setAttribute("src", "../../Documents/dumpster_shit/FB/"+p1+"/0.jpg");
x.setAttribute("class","democlass")
document.body.appendChild(x);
}
});
</script>