Skip to content

Instantly share code, notes, and snippets.

@mjg123
Created July 21, 2011 23:48
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjg123/1098521 to your computer and use it in GitHub Desktop.
Save mjg123/1098521 to your computer and use it in GitHub Desktop.
Same jsonp call as before but with gclosure instead of jQuery
(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