Capqueen
Capqueen

Reputation: 71

jquery mobile a link can not work while using knockoutjs data-bind

I write a link by jquery mobile like: < a href="#detail" />

it work first time.

then I modify it use ko bind,like: < a href="#detail" data-bind="click:newAdvice">

it can not chagePage, I do not know why?who can help me?

Upvotes: 0

Views: 100

Answers (1)

cvelinho
cvelinho

Reputation: 576

Try to set for link data-bind click:

<a data-bind="click: showHomepage" data-role="button">Homepage</a>

This is javascript:

self.showHomepage= function () {
        $.mobile.changePage("#Homepage", {
            transition: "slide"
        });
        return false;
    };

and html for Homepage is:

<div data-role="page" id="Dashboard">
...
</div>

Upvotes: 1

Related Questions