javascript - Jquery .get not retrieving file -
i have code supposed read html file, split array , display parts of array, when going though alert, found $.get not getting file <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> </script> </head> <body> <button onclick="myfunction()">update</button> <div id="div1"></div> <script> function myfunction() { var info = ""; $.get("../read_test/text.html", function(data) { somefunction(data); }); alert(info); var array = info.split("§n"); var people = array[1].split(","); (var = 0; < people.length; i++) { document.getelementbyid("div1").innerhtml = people[i] + "<br>"; } } function somefunction(data) { ...