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

  • Home
  • SEARCH
  • 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 3222164
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:57:34+00:00 2026-05-17T15:57:34+00:00

I just got help with the jQuery portion of this code (thanks David Thomas)

  • 0

I just got help with the jQuery portion of this code (thanks David Thomas)

this is my current code so far, I was wondering what else I need so that the results are returned.

            <div class="toolbar">
                <a href="javascript:void(0);" onclick='$("#addC<?=$_SESSION['user_id'];?>").toggle();'><p id="addC20" style="float: left"></p></a>
                <p style="float: right; position: relative; top: 0px; left: -10px;">Contact Manager</p>
            </div><!-- end toolbar -->
            <script>
                $(document).ready(function(){
                    $('#names a.names').click(function(){
                        var thisId = $(this).attr('id');
                        $('#detailsPane').load('dependencies/ajax/contacts.ajax.php #' + thisId);
                        return false;
                    })
                });
            </script>
            <div id="names">
                <h3>Contacts</h3>
                <ul id="post">
                <? while($row = mysql_fetch_array($contacts)) ?>
                    <li><a class="names" id="<?=$row['id'];?>"><?=$row['first_name'];?>, <?=$row['last_name'];?></a></li>
                </ul><!-- end post -->

            </div><!-- end names -->

            <div id="detailsPane">

            </div>
            <div class="cushion"></div>

From this, the names or contacts are pulled from my database in my while loop, but I think whats causing me logic and confusion is how the ajax.php will then grab the ID from the ‘a’ anchor and pass it into my new output. What code do I need to format the data in my detailsPane?

  • 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-17T15:57:35+00:00Added an answer on May 17, 2026 at 3:57 pm

    I see no need to do that .load() with a hash url segment instead of a plain old GET parameter:

    $('#detailsPane').load('dependencies/ajax/contacts.ajax.php?id=' + thisId);
    

    Then in contacts.ajax.php you will get it as such:

    $id = $_GET['id'] ;
    

    Obviously you will need to sanitize and validate the id but that’s not in this question’s scope.

    Then, based on that id contacts.ajax.php should just print out any output you wish to show in #detailsPane, and .load() will take care of it.

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

Sidebar

Related Questions

(please excuse that I didn't use aliases). I would like my query output to
I'm working on a project in C# w/ XNA, and I want to reorganize
I am playing with TFS 2010, and am trying to setup a build process
My question is about memory use and objects in actionscript 2. If I have
I have a new web app that is packaged as a WAR as part
There doesn't seem to be any tried and true set of best practices to
I am using a 3rd-party rotator object, which is providing a smooth, random rotation

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.