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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:41:11+00:00 2026-06-11T13:41:11+00:00

I am using Acuity Scheduling for a project. It uses prototype.js and allows me

  • 0

I am using Acuity Scheduling for a project. It uses prototype.js and allows me to add my own custom code to the head and footer of the page (served to my site via iframe). I’m not familiar with prototype.js, so I’m using jQuery in a way that it won’t conflict. My jQuery code and prototype.js were working just fine, until I added this code:

jQuery('body').html(jQuery('body').html().replace('an Appointment','a Session'));

I’m looking for a way to replace specific words in the iframe using jQuery without breaking the other jQuery code or prototype.js.

You can see the content of my iframe here: https://acuityscheduling.com/schedule.php?owner=11134756

If you view the source, you’ll see the code I added at the bottom:

<script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> 

<script language="javascript">
  jQuery.noConflict();

  jQuery(document).ready(function(){
    jQuery('body').on('click', '.time-selection', function() {
      jQuery('.continueAlert').hide();   
      jQuery('#rest').append('<p class="continueAlert">Please enter your name and contact info below.</p>');  
    });

    jQuery('body').html(jQuery('body').html().replace('an Appointment','a Session'));

  });
</script>

Thanks for any help you can offer!

  • 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-11T13:41:12+00:00Added an answer on June 11, 2026 at 1:41 pm

    I see you have some event listeners setup by prototype targeting specific elements:

    Event.observe(input, 'focus', function(){InputPrompt.focus(input);});
    Event.observe(input, 'blur', function(){InputPrompt.blur(input);});
    Event.observe(input, 'keypress', function(){input.label.hide();});
    

    (there may be more of them, but these were what I was able to quickly spot)

    When you replace an element’s innerHTML property (which is what you’re doing with your jQuery find/replace snippet), the browser basically “throws away” the old DOM elements and creates new ones. So the elements you’re seeing on the page after you update innerHTML aren’t the same once you were previously seeing, which were the ones that have the event listeners attached to them. That’s why everything “stopped working”

    I see two options:

    1. Update your find/replace script to only update text nodes. That will ensure that the containing elements that have the event listeners won’t get messed with.

    2. Use event delegation that doesn’t target specific elements. Check out Event.on, paying close attention to the optional ‘selector’ parameter. Something like:

      document.on(‘focus’, ‘input’, function(event, inputElement) {
      InputPrompt.focus(inputElement);
      });

    I feel like the the first option would be less intrusive to the code that’s already established on this page.

    Edit: Here’s a very brute-force method to find/replace on all text nodes (using Prototype). There’s probably a more efficient way of doing this. Unfortunately, you can’t use a CSS selector to match on text nodes, hence all the filtering of childNodes and whatnot –

    document.body.select('*:not(script)').each(function(el){
      $A(el.childNodes).each(function(child){
        if (child.nodeType === 3) { // only get text nodes
          child.nodeValue = child.nodeValue.replace('an Appointment', 'a Session');
        }
      })
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Acuity Scheduling for a project. It uses prototype.js and allows me
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using CI for the first time and i'm smashing my head with this seemingly
using a binary search tree I need to add to a vector all int
Using WebViewBrush I can render web page content (it's screen shot) to e.g. Rectangle
Using EF Code First I have an model object that has multiple properties that
Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
Using doxygen and graphviz with my C# project, I can generate class diagrams in
using Silverlight I am having trouble with the following code: CultureInfo culture = new
Using ASP.Net and VB.Net Code Image1.ImageUrl = c:\Blue hills.jpg The above code is not

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.