• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to call javascript function on body load using jquery

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using jquery $(document).ready function and in that i have some jquery ajax code that brings some required data from server. Now problem is, the ajax request is going to backend when the page is loaded for first time. But when user navigates to another link and click on back button of the browser the ajax request is not going. I want ajax request to be made each time when control comes to page. I am not sure whether the 'ready' function of jquery runs only once when page is loaded for first time or it runs each time when the control moves to respective page. Please suggest me some solution.
Thanks
Kranthi
 
kranthi chamarthi
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have kept an alert statement in my $(document).ready function and it is getting printed every time the control comes to the page, problem is with jquery ajax code...the ajax request is not going to server when control comes to the page again and again..What might be the reason for this.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you cached? That is what get requests are supposed to do. Fiddler or any other proxy should show you what happens with the http request.

Eric
reply
    Bookmark Topic Watch Topic
  • New Topic