S
S
Stepan2014-08-14 22:04:20
JavaScript
Stepan, 2014-08-14 22:04:20

How to implement transition to a new page in Backbone?

A couple of questions have come up.
There is an application that, if successful, should take the user to a new page (using a route)
How to make a transition on a button click?
Is it possible that everything that is on the page is removed and a new template is inserted from the new view?
And how if possible?
Well, that is, as if these are two different pages?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maks_ohs, 2014-08-14
@xoma2

Backbone.history.navigate("/адрес route на который нужно перейти");

This method is used both in the first and second case (by clicking on the button)
view.render().el returns the usual html, which can be inserted into any tag, for example, in body, while replacing the html that is already there.
$('body').html(view.render().el)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question