简体   繁体   中英

“Ignore”-URL for crossroad.js when using the A-tag with slick-binding

I'm using knockout.js and crossroad.js. (The later was configured by yeoman. I'm not sure I need it, but for now I don't know how to setup the project in another way.)

I have many a-tags with click-binding like this:

<a href='#' data-bind='click: select '>

Unfortunatelly, href='#' causes crossroars.js to change the location to home. If I remove href='#' from a-tag, the cursor over the a-tag buttons change to edit-cursor, which is not nice.

Can I use any other "dummy" value href-attribute which is ignored by crossroads.js?

If you set the cursor with CSS, you don't need an href at all.

 .clicky { cursor: pointer; } 
 <a class="clicky">Whatever</a> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM