Never thought of that, good idea though. Do you recommend having the jsonTree() function check if its a valid URL, or using a separate function?
Or you could also refactor the JSONTree function to (a) check if the first param is an object or string and (b) put the meet of the request eventListener (lines 24-35) into a separate function that's called as appropriate in each case.