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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:27:13+00:00 2026-05-20T06:27:13+00:00

I have some data formatted into a table. I want to setup an onclick

  • 0

I have some data formatted into a table. I want to setup an onclick button that will get the url of a link inside one of the TD’s in the row and then load the results in a row below. Here’s an example of a row. Assume there are no ID’s in the table.

<tr>
    <td>Title of something</td>
    <td><a href="link_to_something.html">Link</></td>
    <td><button onclick="load_file(this.??);">Show Page</button></td>
</tr>

The javascript will need to:

function load_file( , ) {
    //  get the url in the second <td>
    //  urlencode the url
    //  append a new <tr><td colspan="3"></td></tr> below
    //  load some_file.php and pass the variable (file_url) and value (urlencoded) using the .load method in JQuery and load the results into the newly appended <td>
    }

I have read up on the .load method in JQuery. Is it possible to load the results if the TD has no ID?

I guess I could set an ID for all the Table elements if this proves too difficult without ID’s, but just trying keep my php script simple and do the “as needed” stuff with JQuery.

  • 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-20T06:27:14+00:00Added an answer on May 20, 2026 at 6:27 am

    Here’s an example of sorts you can use

    Your HTML. Notice I added a class to the button, and a type.

    <table>
    <tr>
        <td>Title of something</td>
        <td><a href="link_to_something.html">Link</></td>
        <td><button class='thebutton' type='button'>Show Page</button></td>
    </tr>
    </table>
    

    Your JS

    $('.thebutton').click(function(){
        var $this = $(this);
        var $td   = $this.parent('td');
        var url = $td.prev().children('a:first').attr('href');
        var row = '<tr><td class="data" colspan="3"></td></tr>';
        $td.parent().after(row);
    
        //var data  = getData(); //use whatever method you want - $.post, $.get, $.load
        var data  = 'hello';
        $td.parent().next().children('td:first').html(data);
    });
    

    http://jsfiddle.net/jomanlk/4d39N/

    You’ll need to change it to load your data whichever way you want, but everything else works.

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

Sidebar

Related Questions

I have been trying all day to get some data properly formatted in a
I want to save some XML formatted data into the Application Support folder, but
I have some data that's formatted as follows: dtau E_av variance N_sims Time 0.001
I have some data (text files) that is formatted in the most uneven manner
I have come across various situations, where I want to store some formatted data
I have been given some poorly formatted data and need to pull numbers out
I have some data that is stored in a TIMESTAMP(6) WITH TIMEZONE column in
I have a logging setup in python application that logs into file and MongoDB.
I have data stored in a SQL database that I'm attempting to read into
I have a .txt file that has a bunch of formatted data in it

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.