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 5994917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:53:09+00:00 2026-05-22T23:53:09+00:00

I have some jQuery code that runs on every $(document).ready() event. I also have

  • 0

I have some jQuery code that runs on every $(document).ready() event.
I also have some <f:ajax> tags that do re-rendering of some parts of the page.

I noticed that when I rerender a component, the $(document).ready() doesn’t get called.

Is there a way to run javascript code after every <f:ajax> rerendering?
(I can technically use the onevent tag but that’s the unfavourable solution to me since I will have to call the function on every <f:ajax>)

Just for illustration, this is the jQuery Code:

$(document).ready(function() { ...CODE... }

And the JSF code:

<f:ajax event="click" render=":someComponentID"/>

Thanks!

UPDATE This question might be a duplicate of this one. I’m looking into it.

UPDATE2
This is easily solvable using the JSF Javascript event binding:

jsf.ajax.addOnEvent(function(data){
  if (data.status === 'success') {
    // Do stuff here
  }
}

Read more about it under the JSF 2 reference

  • 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-05-22T23:53:09+00:00Added an answer on May 22, 2026 at 11:53 pm

    The $(document).ready() event fires once, when the DOM has fully loaded from the initial load.

    An ajax event may change the DOM, but it doesn’t reload the page, so the $(document).ready() won’t fire again.

    I noticed the way Google solved this problem in Gmail is by using a high frequency timer.

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

Sidebar

Related Questions

I have some jQuery code. I have called an Ajax function file, file.php, that
I have some jQuery code that runs fine until I add the jQuery UI
Alright, so I have some jQuery code that will send an AJAX request to
I have some jQuery/JavaScript code that I want to run only when there is
I have some jQuery code that highlights which radio button is checked by turning
I am a bonifide jQuery novice and I have some jquery code that I
I have some JQuery Code as follows: $(#sh-zone-button-cart-menu).live(click, function(event) { event.preventDefault(); $(#sh-zone-cart-menu).toggle(0, function(){ if($(this).is(:visible)){
I have some content being loaded asynchronously on a server that runs jQuery 1.3.2
I have some jQuery code that finds elements with the shaded CSS class and
I have some HTML and jQuery that slides a div up and down to

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.