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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:57:17+00:00 2026-06-15T13:57:17+00:00

I cant think in how i can do this some help please. I get

  • 0

I cant think in how i can do this some help please.
I get some json objects and one of the values has html tags, some images, of course i cant fetch the images because they have relative urls, and the site it is host in a sub-domain.
Is there any way to add the http://example.com/ to the already existing images/image.png

thanks

this is my json response:

description": "<img src=\"images/stories/Icons/Vacuum.png\" mce_src=\"images/stories/Icons/Vacuum.png\" border=\"0\" alt=\"Vacuum\" title=\"Vacuum\"> <img src=\"images/stories/Icons/Washing_Machine.png\" mce_src=\"images/stories/Icons/Washing_Machine.png\" border=\"0\" alt=\"Washing Machine\" title=\"Washing Machine\"></p>"

for(var i = 0; i < objJsonA.length; i++){
    var ap = objJsonA[i];
    var lot = ap.lot;
    $('.myclass').html(lot);
}

this returns 404 errors, the content i’m fetching it is on http://www.mysite.com and i am on m.mysite.com

  • 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-15T13:57:18+00:00Added an answer on June 15, 2026 at 1:57 pm

    You can use document.location to get the current server. For example, on the URL for this server in Chrome console I see:

    > document.location
    Location
    ancestorOrigins: DOMStringList
    assign: function () { [native code] }
    hash: ""
    host: "stackoverflow.com"
    hostname: "stackoverflow.com"
    href: "http://stackoverflow.com/questions/13754450/adding-extra-parameters-to-url-src-with-jquery"
    origin: "http://stackoverflow.com"
    pathname: "/questions/13754450/adding-extra-parameters-to-url-src-with-jquery"
    port: ""
    protocol: "http:"
    reload: function () { [native code] }
    replace: function () { [native code] }
    search: ""
    toString: function toString() { [native code] }
    valueOf: function valueOf() { [native code] }
    __proto__: Location
    

    So you could use:

    var image = '/images/abc.jpg';
    var url = document.location.origin + image;
    // url is now 'http://stackoverflow.com/images/abc.jpg'
    

    There are a lot of plugins for working with URLs in JavaScript/jQuery and it probably makes sense to use one of them (example search).

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

Sidebar

Related Questions

I'm pretty confused by this one and can't think of anything obvious that I
can't seem to get this parser to work for google maps, I think its
I've been thinking about this and I just can't think of a way to
Apologies if I've got the terminology wrong here—I can't think what this particular idiom
I feel like this is a stupid question, but I can't think of a
Sorry for the poor title, can't think of a succinct way of putting this..
Okay at first I thought this would be pretty straightforward. But I can't think
i think this is a simple question but I've searched around and can't seem
I can't seem to find this information in other questions, even though I think
I think this is a pretty basic question, but after Googling around I can't

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.