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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:44:03+00:00 2026-05-13T19:44:03+00:00

People, here I got some answers how to replace part of a HREF attribute

  • 0

People, here I got some answers how to replace part of a HREF attribute of a link. Eventhough I didn’t understand how the “////\”‘s works.

I need to do the following:
A code that replace, in each “A IMG”, the SRC 1.bp.blogspot.com/_YfY-Tbu-shE/S3q2T9SJQxI/AAAAAAAAAI8/w0kTOPwaxqs/s1600-h/TELA%204.png to 1.bp.blogspot.com/_YfY-Tbu-shE/S3q2T9SJQxI/AAAAAAAAAI8/w0kTOPwaxqs/s1600/TELA%204.png. Resuming: remove the -h from the SRC.

Could also explain, with examples, the “////\”‘s tricks please? (or a page that shows it – didn’t understand the examples in jQuery page)

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-05-13T19:44:03+00:00Added an answer on May 13, 2026 at 7:44 pm

    patrick provided a nice way of removing the “-h” from the URL, with the noted exception of problems that might occur if the pattern “-h” shows up elsewhere in the URL, but I wanted to see if I could help by showing this as part of a more complete solution.

    $(function() {
        $('img[src*="s1600-h"]').each(function() {
            var newSrc = $(this).attr('src');
            newStr = newSrc.replace(/-h/,'');
            $(this).attr('src', newSrc);
        });
    });
    

    What this does is look for all “img” tags with an src containing s1600-h. Then, using a simple regular expression replacement, we take out the “-h”, and update the src accordingly. You can work on refining these patterns if you find that certain things need to change, like s1600 being different each time? Or if the “-h” needs to be more specific.

    Good luck!

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

Sidebar

Related Questions

After a few questions and some nice answers and friendly helpers here. I got
I have asked a similar question here and got some answers, so first of
Some time ago, people here helped me very well with code. Now I'm tasked
I got this image to tell people that some action is loading: http://problemio.com/img/ajax-loader.gif Then
I've got an app that hosts simple html pages for people. Some of whom
Like many people here, I started my programming experience with the good ol' green
It seems like a lot of people here and on many programmer wikis/blogs/ect. elsewhere
I used to have tables before to display the content and people here advised
Here a lot of people are confused, Normal class stores its data in the
Here and there people keep talking about memory leaks which occur due unreleased event

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.