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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:21:40+00:00 2026-06-01T18:21:40+00:00

I have a GM script that adds buttons next to certain hyperlinks on Facebook

  • 0

I have a GM script that adds buttons next to certain hyperlinks on Facebook pages. However, any AJAX update nukes the buttons in that section of page (i.e. when you click ‘view more comments’ – all the buttons on that thread vanish)

What I desire to do:
Re-run my GM function after certain AJAX operations complete – mainly when viewing more comments & loading a new page (I.e click to a different group page, this is all AJAXed)

what I currently do:
Have a 30 second loop that just re-runs my code every 30 seconds. not ideal. Setting a shorter loop will just cause lag
Edit – it actually makes more and more buttons. Super not ideal!

How you can help:
what code should I use to trigger my function after AJAX finishes loading something? What should I be doing so that my code only fires upon my desired AJAX updates, such as the ‘new page’ & ‘more comments’ updates?
Edit – I need to re-run my code only on the updated bit (is this even possible?)

Notes:
I have searched a bit and find a number answers for plain jQuery, asp.net, etc., but not the GM-jQ combo.

  • 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-01T18:21:42+00:00Added an answer on June 1, 2026 at 6:21 pm

    This is a common problem.

    Use the waitForKeyElements() function as shown in this answer.

    By default, it will handle every new element, of the type that you specify via jQuery selector, once each, and within milliseconds of that new element appearing.

    ~~~
    Link to the target page and specify exactly what you are doing for a more specific application.

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

Sidebar

Related Questions

I have a JS/jQuery script that adds our leads (web contacts) to the DOM
I have found a script that adds mouse trail on Opera's mouse gesture. Very
I have a script that adds all children from the current clicked element to
I have this script in BASH (linux) shells script that adds all *.jar files
I have made a script that adds files to a zip (after lots of
I have a script that adds several of these forms. var html = '<div
Let's say I have an embed code with a script that adds events to
I have a problem with using a script that adds a NiceEdit toolbar to
I have a script that checks something on my PC every 5 minutes and
I have a script that connects to SQL Server 2005 default instance. But I'm

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.