Fork me on GitHub
#om-next
<
2017-02-13
>
sova-soars-the-sora21:02:24

Very beginner question: How can I make my javascript :onClick event follow a link?

sova-soars-the-sora21:02:39

And also maybe display the destination in the status bar?

sova-soars-the-sora21:02:15

Okay, I got it. (set! js/window.location.href "http://whereyouwannago.net")

sova-soars-the-sora21:02:53

But now I have a new question: how can I prevent event cascades? I have a big thing that links to something, a small thing on top of the big thing that links to something, if I click the small thing, I get two actions / changes...

kgxsz22:02:58

@sova - (fn [e] (do-something) (.stopPropagation e)) as the on-click fn might help.

sova-soars-the-sora22:02:53

@kgxsz awesome! that did the trick.

kgxsz22:02:56

Also @sova, if you want the destination in the status bar of the browser, use an a element with href.