jquery - read the contents of a".sql" file display it on a web page -


i have sql file stored in local pc. need display contents of file on webpage using jquery.any code snippet can make work ?

i have tried using .load(path) function not getting result.

here 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 combobox list of available queries. based on option selected, need read contents of corresponding .sql file , display contents inside textarea id: queryta

try this

$(document).ready(function () {             $("#query").change(function () {                 var query = $("#query option:selected").text();                  var path = "./resources/web-inf/sqlqueries/" + query + ".sql";                 alert(path);                 jquery.get(path, function(data) {                $('#queryta').html(data);             });         }); 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -