backbone.js - Backbone navigate triggers twice in Firefox -


trying use backbone's navigate property.

 this.navigate("week/" + companyname + "/" + employeeno + "/" + weekend, { trigger: true, replace: false }); 

the code above executed once.

it hits this:

routes: {     "week/:companyname/:employeeno/:weekend": "getweek" }, 

and function gets hit twice:

getweek: function (companyname, employeeno, weekend) {     console.log('getweek:', companyname, employeeno, weekend);  } 

it logged twice in firefox, once in ie , chrome.

what's issue here? didn't have trigger set true, , firefox ignored , still triggered url.

i had similar issue firefox doing 2 server calls after backbone.navigate. in case because had not encoded string. company name have characters should encoded?

you try:

this.navigate("week/" + escape(companyname) + "/" + employeeno + "/" + weekend, { trigger: true, replace: false }); 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -