change

Triggered when the fragment part of the URL changes.

Event Data

e.url String

The fragment part of the URL

e.params Object

The parsed query string parameters of the URL

Calling the preventDefault method of the event object will stop the change and restore the previous URL.

Example

<a id="link" href="#">Click me</a>
<script>
var router = new kendo.Router();

router.route("/items/:category/:id", function(category, id, params) {
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(category, "item with", id, " was requested by", params.user);
});

router.bind("change", function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log("change event", e);
});

$(function() {
  router.start();
  $("#link").click(function() {
    router.navigate("/items/books/59?user=John");
    return false;
  });

});
</script>
In this article
Not finding the help you need? Improve this article