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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:23:06+00:00 2026-06-04T09:23:06+00:00

This is a followup to the solution for this question. I am using jQuery’s

  • 0

This is a followup to the solution for this question.

I am using jQuery’s load() function to pull a headline within a div tag from one page to another within my site. This works wonderfully.

The problem is, load() also pulls the div tag itself, which I do not want, as it then gets formatted via CSS like the source page.

Here is the PHP:

function get_team_articles($team_id, $feat=0) {
    .
    .
    .
    while ($row = mysql_fetch_assoc($r)) {
        $page = explode('_', $row['page_id']);
        (is_numeric($page[1]))
            ? $pre = 'wk_'
            : $pre = '';
        $arr[] =    $page[0] . " | " . $pre . $page[1] . ": " . "
                    <a linked_div='news_header'
                    linked_path='../news/" . $page[0] . "/" . $pre . $page[1] . "/" . $page[1] . "_" . $page[2] . ".html'
                    href='index.php?view=news&yr=" . $page[0] . "&wk=" . $page[1] . "&pg=" . $page[2] . "'></a>";
    }

    $articles = implode('<br/>', $arr);
    return $articles;
}

Notice the linked_div and linked_path attributes within the anchor tag, which are used in my jQuery:

function set_team_headlines(){
    $('#section-articles > a').each(function() {
        var a = $(this);
        a.load(a.attr('linked_path') + ' #' + a.attr('linked_div'));
    });
}

Obviously I cannot strip the HTML tags within the anchor tags in PHP, because the server doesn’t have the text within the anchor tags upon loading; so I assume I need to strip the HTML in jQuery after the load() call…and that is what I cannot figure out how to do. 🙂

The result I want is:

<a href="...">My headline</a>

The result I’m getting is:

<a href="..."><div id="news_header">My headline</div></a>

Hopefully this makes sense. I think I provided more detail than I needed to. Thanks!

  • 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-04T09:23:08+00:00Added an answer on June 4, 2026 at 9:23 am

    Navigate down one more level in your .load selector

    a.load(a.attr('linked_path') + ' #news_header');
    

    If your news_header id isn’t unique, it isn’t valid to select by that id (ID’s must be unique!)

    To get around that issue, use this:

    a.load(a.attr('linked_path') + ' #' + a.attr('linked_div') + ' div');
    

    Edit:
    .load actually includes the targeted element when appending html instead of appending the target element’s children. I would move to using $.get().

    $.get(a.attr('linked_path')).done(function(html) {
        a.text($(html).filter("#news_header").text());
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As kind of a followup to this question I've gotten a solution working on
This is a followup question of How to encode characters from Oracle to Xml?
This is a followup/post question to another question; as I have discovered a solution
I ask this question as a followup of this question . A solution that
This is a followup to my previous question. Parsing file names from a character
This is a followup question from my original question: Best strategy for migrating mysql
This is a follow-up to the question: Should the folders in a solution match
This is a follow up to another question of mine. The solution I found
This is a followup question to what I had asked about Contents of plist
THis is a followup to my previous question Font-dependent control positioning. It's an attempt

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.