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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:34:41+00:00 2026-05-22T21:34:41+00:00

First of all, I apologize for my poor English. I’m using jquery plugin jParse

  • 0

First of all, I apologize for my poor English.

I’m using jquery plugin jParse which parse xml easily. here is the demo page(http://jparse.kylerush.net/demo)

I’ve tried a couple times but can’t seem to figure out how to remove <a> tag if the href is empty.

Here is my code:

elementTag: ['category', 'pubDate', 'title', 'link', 'description'];
output: '<dl><dt class="jpet00">jpet01</dt><dd><strong><a href="jpet03">jpet02</a></strong><br />jpet04</dd></dl>';

if the xml ‘link’ node is empty, i want to output like this

output: '<dl><dt class="jpet00">jpet01</dt><dd><strong>jpet03jpet02</strong><br />jpet04</dd></dl>';

I tried $(“a[href=”]”).remove() but it didn’t work.

Are there any suggestions? Thanks in advance!

  • 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-22T21:34:42+00:00Added an answer on May 22, 2026 at 9:34 pm

    Where are you calling $("a[href='']").remove() – it should be in your finish() function shown in the demo. If this is where you are using it it may be that the href is not entirely empty. Try:

    function finish() {
        jQuery('#jparse-meta').remove();
        $('a').each(function() {
            var string = $(this).text().replace(/\s{2,}/g, '')
            if (string == "") {
                $(this).remove();
            }
        });
    }
    

    EDIT 1 as requested in comments

    function finish() {
        jQuery('#jparse-meta').remove();
        $('a[href=""]').each(function() {
            $(this).parent('strong').html($(this).text());
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all I have to apologize for my poor English, Please let me
first of all apologize for my English. I have a problem it takes days
Hello guys first of all apologize for asking such a simple and yet redundant
First of all (in case this is important) I'm using ActiveState's Perl (v5.8.7 built
First of all I apologize in advance for this question, a bit off the
Hello fellow developers. First of all I apologize beforehand for the wall of text
First of all, I apologize if this is a stupid question, I'm a dead
First of all, I would like to apologize for posting this again. I am
Long time listener, first time caller here. Ok, I apologize for the length of
First of all - I apologize if this question shows ignorance or I'm not

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.