Skip to content

Instantly share code, notes, and snippets.

@mikedugan
Created November 7, 2013 14:41
Show Gist options
  • Select an option

  • Save mikedugan/7355659 to your computer and use it in GitHub Desktop.

Select an option

Save mikedugan/7355659 to your computer and use it in GitHub Desktop.
inputs text from file (ie xml) into input box
//uses a select box to input content from file into a text area
var sel = $('select');
sel.change(function() {
var f = $(this).val();
$.get("./path/to/file/" + f, function(d) {
$('textarea').val(d);
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment