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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:25:44+00:00 2026-05-13T11:25:44+00:00

I am rewriting a helper class which was originally built on top of Scriptaculous.

  • 0

I am rewriting a helper class which was originally built on top of Scriptaculous. I am moving to jQuery – however, I am stuck on a couple of lines, that I need help with (see below): Note: the javascript code is interpersed with php variables (the sigils being a dead give away)

Statement 1

'new Insertion.Before(\'' . $updateContainer . '\', new Element(\'div\', {\'id\': \'' . $updateContainer . '_loading\', \'class\': \'' . $spinnerClass .'\'})); $(\'' . $updateContainer . '_loading\').innerHTML="<h4>Loading ...</h4>";',

Statement 2

'$(\'' . $updateContainer . '_loading\').remove();'
  • 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-13T11:25:44+00:00Added an answer on May 13, 2026 at 11:25 am

    I’ll assume that the $updateContainer is ID of the HTML element that contains the loading message.

    Then, I’d write the Statement 1 like this:

    $statement1 = sprintf('$(\'#%1$s\').html(\'<div id="%1$s_loading" class="%2$s"><h4>Loading</h4></div>\');', $updateContainer, $spinnerClass);
    

    And the second statement is:

    $statement2 = sprintf('$(\'#%s_loading\').remove();', $updateContainer);
    

    If you have a lot of AJAX communication and need the ‘Loading’ often, it might be better to hide() it so you can just show() it later instead of creating the HTML again.

    Statement1 would be uset to create the loading element, Statement2 with hide() instead of remove() to hide it and Statement3 with show() instead of hide() to show it again.

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

Sidebar

Related Questions

I've got a rather large plugin that I am currently writing in jQuery which
Possible Duplicate: Rewriting URL that contains question mark Hi a noob question for url
I read everywhere that rewriting history of commits that have been published is bad
Rewriting an html element's content, or itself is easy via jquery, but is it
I am rewriting some old JavaScript with jQuery and would like to know how
I am rewriting an Access application that uses a lot of Temp tables. Meaning
Migrating (rewriting) a whole portal originally made in .net to shareopoint doesn't seem like
I`m rewriting an application that use MS Access as the database. I was able
Im rewriting application from .NET to PHP. I need to create class like this:
I'm rewriting one of our forms so that it can handle international domains, but

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.