Skip to content

Instantly share code, notes, and snippets.

@ti-ka
Created March 20, 2017 18:55
Show Gist options
  • Save ti-ka/efa4ccdf2f1b2da6d5e01ffb7789da50 to your computer and use it in GitHub Desktop.
Save ti-ka/efa4ccdf2f1b2da6d5e01ffb7789da50 to your computer and use it in GitHub Desktop.
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
try {
//Assuming the location and filename as below
var url = "http://localhost:8080/homestead.txt";
$.ajax(url)
.success(
function(responseText){
console.log(responseText)
loadContentAsync(responseText)
}
);
function loadContentAsync(str) {
str = str.replace(/["']/g, "");
var result = str.split('|');
$("#txtAssessmentNumber").val(result[0]);
$("#txtBriefPropDescr").val(result[1]);
$("#txtPhysicalAddress").val(result[2]);
$("#txtPhysicalCity").val(result[3]);
$("#txtPhysicalZip").val(result[4]);
}
} catch (e){
console.log("Homestead File not found at specified server.")
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment