Skip to content

Instantly share code, notes, and snippets.

/gist:c9c2fe05606de72f5a59 Secret
Created Dec 29, 2012

Embed
What would you like to do?
(defn select-turn
"select turn starts the game when the a player selects x or o from modal window."
[e]
(let [turn (.data $button "turn")
url ( apply str (+ "/game/" turn))]
;;Close bootstrap's modal window.
(.modal $turn-prompt (clj->js "hide"))
;; set the user turn in UI.
(set-turn turn)
;; console log with my console fnc.
(console-log url)
(comment "
current error for next line:
Uncaught TypeError: Illegal invocation cljs.js:5591
b cljs.js:5591
a cljs.js:5628
tic_tac_toe.core.select_turn cljs.js:14374
v.event.dispatch jquery-1.8.3.min.js:2
o.handle.u)
in js this would be something like history.pushState(null, null, '/game/'+turn);")
(apply js/window.history.pushState (clj->js [nil nil url]))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.