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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:52:05+00:00 2026-05-23T03:52:05+00:00

i have a rails 3.1rc4 app and i would like to update a div

  • 0

i have a rails 3.1rc4 app and i would like to update a div in my index.html.erb file after every 10sec. I dont no if this can be done via jquery? there use to be a update method but i dont no if it is for only prototype. any sample would be great

  • 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-23T03:52:06+00:00Added an answer on May 23, 2026 at 3:52 am

    Breaking down your question into sub-tasks, here’s what you have to deal with:

    1. retrieve (HTTP GET) html
    2. update a div with the retrieved html
    3. Repeat steps 1 and 2 every 10 seconds

    For 1, check out jquery’s .get

    Description: Load data from the server using a HTTP GET request.

    For 2, check out jquery’s .html

    Get the HTML contents ... or set the HTML contents of every matched element.
    

    For 3, check out the setInterval

    Summary
    Calls a function or executes a code snippet repeatedly, with a fixed time 
    delay between each call to that function. Returns an intervalID.
    

    Final solution,

    HTML Code:

    <div id="divToChange"></div>
    

    Javascript code

      function update()
      { 
         $.get('/', function(data) 
         {
             $('#divToChange').html(data);
         });
      }
    $(document).ready(function($){
      window.setInterval('update()', 10*1000);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Rails 3.1.2 app with a hierarchical relationship that looks like this: Categories
I have a brand new Rails 3.1rc4 project. After generating a scaffold, migrating and
I have Rails app, and every once in a while, when I bring new
I have an existing Rails 3.1rc4 app deployed to heroku on the Bamboo stack.
I have Ruby on Rails app (3.1rc4) and I am constantly getting a couple
I have rails app with a textarea form like <%= form_for Comment.new, :remote =>
I have Rails Application which uses JavaScript Extensively . I would like to know
I have Rails 3.1.3 app and trying to plug gem redis to it. I've
I have rails app which are working perfectly in the local computer. But when
I have a Rails app running Mongoid on Heroku and I need to set

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.