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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:28:10+00:00 2026-05-26T09:28:10+00:00

So basically what I want to do is grab links to images within a

  • 0

So basically what I want to do is grab links to images within a page and convert them to images. Right now, I have code that will grab any link within a post on the forums and converts them to images, but I want it more specific than that. I want to be able to grab images using the main 4 web image extensions (.jpg, .gif, .png, .bmp). I’m new to jQuery so I’d really love some help on this. Here’s my code that I have so far:

(function($) {
    if ($('#nav a[href*="/forum/3828932/"]').length && location.href.indexOf('/1/') !== -1) {
        $('td.c_post:eq(0) a').each(function () {
            link = $(this).attr('href');
            $(this).html('<a href="' + link + '"><img src="' + link + '" alt="Icon" /></a>')
        });
    }
})(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-26T09:28:10+00:00Added an answer on May 26, 2026 at 9:28 am

    You can try to use the ends-with selector to select anchor with href ends with those values
    http://api.jquery.com/attribute-ends-with-selector/

    and multiple selector
    http://api.jquery.com/multiple-selector/

    so your selector may look something like

    $('td.c_post:eq(0) a[href$=".jpg"],td.c_post:eq(0) a[href$=".png"],td.c_post:eq(0) a[href$=".gif"],td.c_post:eq(0) a[href$=".bmp"]')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to grab all inputs of type=text that have nothing entered by the
Let's say I have an image URL http://website.com/content/image.png I want to grab that image
I basically want to do this in code: PersonList myPersonList; //populate myPersonList here, not
I basically want to open a browser window from Word using VBA that does
basically i want to hold a parameter that retrieve value from $.post() call like
I have form and I want to grab the data inserted by users and
Basically I have a site where I want the user to input something, have
Basically I want to be able to grab the ending of an url, and
Basically, I want to use BeautifulSoup to grab strictly the visible text on a
I basically have a webpage with two frames. -Left for nav -Right for main

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.