I can't get these simple things to work, I have an text file with some text in it and I want an alert containing the text thats inside of a text file to be triggered when clicking a "btn/link".
Also I want to be able to compare and see if the text inside the file is true or false:
HTML:
<div id="alert_btn"><a href="javascript:alert_fn();">click_me</a></div>
JQuery/javascript:
function alert_fn(){
$.get('http://www.patan77.com/example_test.txt', function(data) {
alert(data);
if (data == true){
alert("true");
}else{
alert("false");
}
});
}
Thanks in advance.