Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Working with route pushstate

$
0
0
I want my app when it is accessed by URL http://app.domain/{language} 

When I load the app with address  http://app.domain/en I have an "en" language set.

I if set browser's address line is changed (manually or with code) to http://app.domain/de language shroud be set to "de" without page reload.

But this doesn't work (page is reloaded when I change address line) for me with such code:


  1.     $(function(){

  2.         new (can.Control({
  3.             '/:lang route': function(route){
  4.                 setLanguage(route.lang)
  5.             }

  6.         }))(document.body)

  7.         can.route.ready()
  8.     })
What am I doing wrong?

Viewing all articles
Browse latest Browse all 3491

Trending Articles