So I aim to get some text from "clownJokes.txt" which is an external .txt and put that text into a variable inside my .js file.
Currently I know that $.get() from JQUERY calls Ajax and retrieves the file you want from the server. But I am searching for a way to do that locally, is there any way to do that?
$(document).ready(function(){
$.get('clownJokes.txt', function(data){
doSomethingWithData(data);
}, 'text')
})
This is how it would look if I was to retrieve it from the server.
Thanks in advance!