0

on a button in a view I've setted this below, to redirect me to the home page:

 redirect: function(){
    Backbone.history.navigate("", {trigger: true});
    }

it works perfectly but the url in my browser remain with a final #:

assets/www/index.html#

and from this url any href or button don't work while with:

assets/www/index.html

all works perfectly

How can I resolve?Can I remove #?

Stefano Maglione
  • 3,946
  • 11
  • 49
  • 96

1 Answers1

0

This one has been answered somewhere else on stackoverfrow: Backbone.js change url without reloading the page

Long story short: Backbone doesn't seem to offer tools to manipulate url completely freely, but however you can call native Javascript-function

window.history.pushState(“object or string”, “Title”, “/new-url”);

to do the job, as mentioned in that other answer. Above example doesnt relocate you to new destination. You can do that with your original Backbone-function.

Community
  • 1
  • 1
Tohveli
  • 487
  • 5
  • 18