Skip to content

Instantly share code, notes, and snippets.

Created December 29, 2012 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/c9c2fe05606de72f5a59 to your computer and use it in GitHub Desktop.
Save anonymous/c9c2fe05606de72f5a59 to your computer and use it in GitHub Desktop.
(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