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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:06:02+00:00 2026-05-15T03:06:02+00:00

using jQuery i am trying to find out all the URLS that user has

  • 0

using jQuery i am trying to find out all the URLS that user has entered which are not starting with http or https and finally i want to prepend http to all such URLs so that when user clicks on them they are taken to a proper site instead of broken link caused due to entry of URLs without http or https.

Also like to mention that User have a field “Websites they Like” where they enter websites of their interest. So if they like stackoverflow, they may end up writing http://www.stackoverflow.com which will be considered a relative link without http.

Also my requirments are such that i cant prompt user to enter http or https before there urls

  • 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-15T03:06:02+00:00Added an answer on May 15, 2026 at 3:06 am

    If you’re looking to “patch” the URLs of already-rendered anchor tags to include http://, you could probably run through them with something like this:

    $(document).ready( function(){
        $('a:not([href^="http://"]):not([href^="https://"])').each( function(){
            $(this).attr('href', 'http://' + $(this).attr('href'));
        })
    })
    

    Edit: revised to use each().
    Edit: revised to handle http and https.

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

Sidebar

Related Questions

I'm trying to find all text nodes on the page using jquery. But no
I am trying to find a way using jquery without cookies to display a
I am trying to get an element using JQuery's selector, but it does not
I'm trying to build a site that runs without refreshes, using Jquery and PHP
I am trying to find a working jQuery image preloader that plays well with
I have a simple html block like: <span id=replies>8</span> Using jquery I'm trying to
I'm trying to load fragments of XHTML markup using jQuery's $.fn.load function, but it
I'm trying to animate a block level element using jQuery. The page loads with
I'm trying to click on a link using jquery. There only appears to be
I'm trying to execute a asp.net webservice using jquery. When I pass only one

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.