Skip to content
Go to file
Cannot retrieve contributors at this time
17 lines (15 sloc) 523 Bytes
(defn fetch-file!
"Very simple implementation of XMLHttpRequests that given a file path
calls src-cb with the string fetched of nil in case of error.
See doc at"
[file-url src-cb]
(.send XhrIo file-url
(fn [e]
(if (.isSuccess (.-target e))
(src-cb (.. e -target getResponseText))
(src-cb nil))))
(catch :default e
(src-cb nil))))
You can’t perform that action at this time.