Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8476003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:03:26+00:00 2026-06-10T18:03:26+00:00

In davis.js when I reload or load a page in chrome/safari it will generate

  • 0

In davis.js when I reload or load a page in chrome/safari it will generate two requests to my route. When I click on a link it only generates one request. In firefox loading, reloading and clicking on a link will generate only one request. I only want one request to fire so I don’t redraw my content and do my animations twice.

Is there a way I can fix this so I only ever get one request? Should I put a timeout on my route so it can only send one request per x milliseconds? That sounds like a hack though.

Explanation of what I’m doing:
I have a single index page which uses the route to load different content in. It grabs the data from an API and loads an underscore template then places it in the content container.

I am using the latest version of davis.js 0.9.2.

.htaccess setup:

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /catalog/index.php [QSA,L]

davis setup:

var app = Davis(function(){
    this.configure(function(){
      this.generateRequestOnPageLoad = true;
    });

    this.get(directory, function(){
      RenderPage('index');
    });

    this.get(directory+':id', function(req){
      RenderPage(req.params['id']);
    });

    this.get(directory+':id/:page', function(req){
      RenderPage(req.params['id'], req.params['page']);
    });
});

Firefox console:

[Tue Aug 21 2012 16:02:01 GMT-0400 (EDT)] application started
[Tue Aug 21 2012 16:02:01 GMT-0400 (EDT)] runRoute: GET /catalog/users

Chrome console:

[Tue Aug 21 2012 16:01:59 GMT-0400 (EDT)] application started
[Tue Aug 21 2012 16:01:59 GMT-0400 (EDT)] runRoute: GET /catalog/users
[Tue Aug 21 2012 16:01:59 GMT-0400 (EDT)] runRoute: GET /catalog/users 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:03:28+00:00Added an answer on June 10, 2026 at 6:03 pm

    I have pushed a fix for Davis (0.9.3) that should fix these issues.

    At the root of the problem is the difference in the way that webkit browsers (specifically Chrome and Safari) and other browsers treat the onpopstate event.

    The current version of both Chrome and Safari fire an onpopstate event for the initial page load, both Firefox and Opera (and possibly others) do not do this. This difference causes quite a headache when implementing a cross browser library on top of the history API.

    This causes strange cross browser issues with Davis including routes being fired run twice in Chrome and the first route not being run in Firefox if you are navigating using the back button.

    The solution is to keep track of whether the browser has issued the popstate event and whether it is one for an initial page load or not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ryan Davis’s Ruby QuickRef says (without explanation): Don’t rescue Exception. EVER. or I will
I have a two tables Student -------- Id Name 1 John 2 David 3
I've setup-a-msysgit-server-with-copssh-on-windows, following Tim Davis' guide and I was now learning how to use
I am creating an li element dynamically like this: $(data).find('slide').each(function(numSlide){ var slideLink = $(this).attr('link');
Most sites that have some sort of user profile will either do something like
I'm following Scott Davis' tutorials on developing grails apps, but whenever i try to
i am trying to use davis.js history plugin but i have problem (using codeigniter,
I'm playing around with the Ninject Interception extension. Ian Davis's blog post about it
my route implementation on Global.asax protected void Application_Start(object sender, EventArgs e) { this.intRoutes(RouteTable.Routes); }
Ok this is driving me crazy: `ls #{/media/music/Miles Davis}` fails because of the space

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.