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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:52:32+00:00 2026-06-05T17:52:32+00:00

I want to create a page with will be filled with dynamic info using

  • 0

I want to create a page with will be filled with dynamic info using Ajax (JQuery). The info will come from various GETs I need to do in other URLs.
I’ll be using Sinatra + JQuery to to that, but as my WEB experience is almost null and don’t have any idea how do to it right.
The requisites for this are:

  • Each time a GET completes, a new line of information should appear on the page.
  • If the GET could not be complete, a default info appear on the page.

My idea so far is to do something like this:

  • Have my controller performing each GET inside a thread.
  • Each time a thread ends, with success or not, I inform the view of the result and render a partial
  • I’ll have as many partial as I need (for each GET I must do)
  • The first time I load the page I fill in the default info, them I update via AJAX with the successful GET responses

This does not seem the correct approach, so I’m asking someone that already did something similar or has more experience on this some help.

  • 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-05T17:52:34+00:00Added an answer on June 5, 2026 at 5:52 pm

    You start off with a simple get('/'){} route that holds the default message (or any other GET route). Then you have your other GET routes that you want to display on your default route. In Sinatra you can check whether a request is an xhr-request or not with a request.xhr? If you have an xhr request you return a json value to your view, otherwise reject the request or render a view with proper html. This is on your sinatra backend. In your views you can use JQuery or any other JS library or plain JS to handle asynchronous data requests. You can use the ajax function in JQuery to request data from your routes and then add them to your DOM. It’s as simple as that 🙂

    Now you will have to investigate on the JQuery site how to make ajax requests and how to append data to existing DOMs. That’s all there is to it.

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

Sidebar

Related Questions

I want to create a Dynamic aspx Page in current solution through code-behind..forexample i
I want to create multiple versions of print-friendly pages from a single page. I
I want to create a master template that every other view page will inherit.
I want to create a custom page for my WordPress blog that will execute
I want to create a one page site that will use Facebook Connect and
I want to create a simple gsp page which will have an input box
I want to create JSF page which displays Oracle connections. The web page will
I want to create JSF page which displays Glassfish connections. The web page will
i m using html5 and want to create page like master page in asp,
I want to create a JSP page or servlet that will work in 2

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.