This is a migrated thread and some comments may be shown as answers.

Data-bind button with href attribute

0 Answers 225 Views
Button (Mobile)
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 18 Oct 2012, 12:41 AM
I am attempting to add a "click" handler to a button (actually an anchor tag with data-role="button" attribute) that also has an 'href' attribute specified.  Essentially, I want to specify which view the button should link to in the HTML, but run some code prior to switching.

Unfortunately, the navigation appears to cancel out the click handler, so my click event does not fire.  I verified that I had the click event wired up properly by removing the 'href' attribute, and everything works as expected (except the view doesn't change), then when I add the 'href' attribute back in, the click event stops firing.

I hope that makes sense!  Any ideas?

No answers yet. Maybe you can help?

Tags
Button (Mobile)
Asked by
Jeremy
Top achievements
Rank 1
Share this question
or