Created
July 21, 2011 23:48
-
-
Save mjg123/1098521 to your computer and use it in GitHub Desktop.
Same jsonp call as before but with gclosure instead of jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns helloclosure | |
(:require [goog.net.Jsonp :as jsonp])) | |
(defn show [msg] | |
(let [data-as-json ((js* "JSON.stringify") msg nil 4)] | |
((js* "alert") data-as-json))) | |
(defn doajax [] | |
(.send (goog.net.Jsonp. (goog.Uri. "http://api.stackoverflow.com/1.1/users/268619") "jsonp") | |
nil | |
show)) | |
(doajax) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment