Button click causes page navigation (or back navigation?)

2 posts, 1 answers
  1. Jan-Dirk
    Jan-Dirk avatar
    327 posts
    Member since:
    Jun 2012

    Posted 22 Aug 2013 Link to this post

    I am working on a new app (with Kendo UI framework) that currently has 2 views:
    - Home view with a listview and a + button to add items. This view is selectable from the tabstrip
    - An add item view that is not selectable from the tabstrip. You can navigate to this view with the + button on the home view

    On the 'add item' view I have a camera-button (a href with data-role button) that currently shows a picture. When the button is clicked it loads a picture into a div. However, before it actually does that it moves me back to the Home-view.

    This is how I have configured the button
    <a href="" data-role="button" data-icon="camera" id="takePicture"></a>

    And this is how the click event of the button is handled:
    $('#takePicture').click(function(e) {
                $('.picture').attr("src", "./styles/images/logo.png");
                $('.picture').html()
                return false;
    });

    Any reason why a click would cause to move away from the current view?
  2. Answer
    Jan-Dirk
    Jan-Dirk avatar
    327 posts
    Member since:
    Jun 2012

    Posted 23 Aug 2013 Link to this post

    I found the solution. Removing the href="" from the button declaration solved this.
Back to Top