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

The Archive Base Latest Questions

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

I am running a web page from a server using webrick. How can I

  • 0

I am running a web page from a server using webrick. How can I capture an event from the web browser? I do not want to do it through JavaScript, but I want to get a response through webrick, and process it in ruby, perhaps using one of the do_... methods. If JavaScript is minimally needed, that is okay. I do not want to redirect to a different page.
I do not know what to put in the value for an event (like onclick).

<input type=button onclick="..." value="Press Me">
  • 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:48:18+00:00Added an answer on May 23, 2026 at 3:48 am

    After struggling, with the help of this page, I seem to have gotten close to what I wanted:

    xxx.html

    <input type="button" value="Click me" onclick="onclick('value to pass');" />
    

    xxx.js

    function onclick(v){
      e=new XMLHttpRequest();
      e.open("GET", "http://localhost:3000?t=0&"+v, true);
      e.onreadystatechange=function(){if (e.readyState==4 && e.status==200){
        // some code to rewrite if necessary
      };};
      e.send();
    }
    

    xxx.rb

    class WEBrick::HTTPServlet::AbstractServlet
      def do_GET request, response
        # some code to process the request
        response.body = a_return_string_for_rewriting
        response.status = 200
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My app (singe-page layout) receives data from the server and I want a nice
I am running a web server using VB.net and I have a bunch of
I am running Aprelium Abyss Web Server from my home computer and I have
I'm running a web page that has a SL 'box' in it. I know
When running a web application project, at seemingly random times a page may fail
I keep having an error when running my web application. The error does not
I just did an audit of one of my web application page (built using
I am trying to open a web page with a Silverlight App from a
I am debugging a process on a web server running Linux. The process is
after deploying my web app to a new server using the add web setup

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.