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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:06:03+00:00 2026-05-14T04:06:03+00:00

Preface: I consider myself slightly effective in ruby on rails, and a complete novice

  • 0

Preface: I consider myself “slightly effective” in ruby on rails, and a complete novice in javascript. Also, yes, I have installed jQuery and associated plugins instead of the default Prototype library.
I am in a situation where I am pulling in a table from off-site in an iframe (which is taking care of all internal JS for me) such that when a part of the table is clicked, a td will gain the class “active.” What I would like to do is take this info (I’m assuming I can get it in a string format), and pass it to a method (in my controller, I’m assuming) which will parse the html, pull out the pertinent info, and then call a creation method in the same controller with the parsed info, the end result being a new item in that table.

What I have so far is javascript which I believe is correct:

<script type="text/javascript">
  var ImportInfo = function() {
  var info = $('td.active').html();
  // call controller action which parses the given string,
  //checks for existence in database, and adds new row if needed
}

$("#Import").click(ImportInfo);
</script>

and, of course, a button with id=”Import.”

I have looked at this question: Using jQuery To Call A Controller Action but am somewhat unsure as to how to call a controller action to pass the contents of the td as a string. Is this doable with the jQuery post method?

ADDED INFO:
my iframe:

<iframe id='locator' src="http://hosted.where2getit.com/wafflehouse/indexnew.html" width="740" height="700" marginheight="0" marginwidth="0" scrolling="no" frameborder="0" align="bottom" name="plg_iframe">No Frames</iframe>
  • 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-14T04:06:03+00:00Added an answer on May 14, 2026 at 4:06 am

    Too bad you dropped Prototype — I could have helped you better 😉

    jQuery experts feel free to correct me but I believe you want something like:

    <script type="text/javascript">
      var ImportInfo = function() {
      var info = $('td.active').html();
      // call controller action which parses the given string,
      //checks for existence in database, and adds new row if needed
      $.ajax({
        url: '/controller/action',
        data: { paramName: info }
      })
    }
    
    $("#Import").click(ImportInfo);
    </script>
    

    If you wanted to do it with Prototype, you would use:

    <script type="text/javascript">
      var ImportInfo = function() {
      var info = $$('td.active')[0].innerHTML;
      // call controller action which parses the given string:
      new Ajax.Request('/controller/action',{
        method: 'post'
        parameters: { paramName: info }
      })
    }
    
    $("#Import").click(ImportInfo);
    </script>
    

    Now, ater re-reading your question, I see that the <td> you want to get data from is in an iFrame from a different site, is this correct? If so, JavaScript will have no access to that iFrame because of security restrictions. See this MSDN article or google for “Cross-domain iframe security”. If this is your issue, please provide a lot more detail about the two domains in question… you may or may not be out of luck.

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

Sidebar

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.