I have a sql file stored in my local PC. I need to display the contents of this file on a webpage using jquery.Any code snippet that i can get to make this work ?
I have tried using .load(path) function but am not getting any result.
Here is what i have tried:
$(document).ready(function () {
$("#query").change(function () {
var query = $("#query option:selected").text();
var path = "./resources/WEB-INF/sqlQueries/" + query + ".sql";
alert(path);
$("#queryTA").load(path);
});
});
query is a combobox with list of available queries. Based on the option selected, I need to read the contents of the corresponding .sql file and display the contents inside a TextArea with id: queryTA