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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:35:41+00:00 2026-06-12T06:35:41+00:00

I am developing an RSS-Reader with PhoneGap. Everything is working out great so far,

  • 0

I am developing an RSS-Reader with PhoneGap. Everything is working out great so far, but now I want to download linked article pages in advance, so the user doesn’t have to wait for a slow connection.

Getting the HTML is easy via AJAX using JQuery, but I also want the images and CSS. I could get the URLs for the images and CSS from the resulting HTML, but the paths are relative. I thought that would be no problem since I have the base URL. Unfortunately it doesn’t really work as simple as I thought:

One example article would be http://www.golem.de/news/sicherheit-ecall-soll-motorradfahrern-das-leben-retten-1210-94854.html. A containing CSS file has the relative URL /staticrl/styles/golem_main_47-min.css. I tried using the last slash in the URL of the page for finding the base for relative pasths (W3C says that’s the way it sould work). So it would be http://www.golem.de/news/staticrl/styles/golem_main_47-min.css, but the actual file is found at http://www.golem.de/staticrl/styles/golem_main_47-min.css. I could also use the first slash after http:// and that would work for the first three examples I tried, but I’m pretty shure that’s not always working since that’s not how relative URLs work. But how can I be sure what the base is?

Maybe I’m missing a very easy way to do this? I also tried using an IFrame, but JavaScript doesn’t allow acces to cross domain IFrame contents.

Does anybody have any experience with something like this? I’m quite stuck at the moment.

  • 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-12T06:35:42+00:00Added an answer on June 12, 2026 at 6:35 am

    I think you have misunderstood how a relative url works.

    A relative url gets the resource from the host name (http://www.golem.de).

    Not from the host name + last directory path (http://www.golem.de/news).

    You need to parse the article url and get the host name, then append the resource path to the host url. Here is an example function to get the host name:

    var rssUrl = 'http://www.golem.de/news/sicherheit-ecall-soll-motorradfahrern-das-leben-retten-1210-94854.html';
    
    GetHostName(rssUrl) // www.golem.de
    
    function GetHostName(url) {
       return url.match(/:\/\/(.[^/]+)/)[1];
    }
    

    You might want to modify the regex to keep the protocol (http://), or find some other way to parse the host name from a url.

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

Sidebar

Related Questions

I'm developing an rss feed reader that uses a bayesian filter to filter out
I have been developing an Android RSS news reader.I want to add two buttons
i am developing an android app that fetches an RSS feed, now i want
i am developing Rss Feed Reader App in j2me(java) for 2 xml files,but my
I am developing an android rss reader but the problem i am facing is
I am developing an Android RSS reader. My work almost done, but I have
I Have been developing an Android RSS reader.I want to fetch the images from
I'm developing a news reader app, so I parse RSS feed data and then
I am new to iPhone developing. I want to integrate BBC Olympic RSS feeds
I'm developing a demo RSS reader for iPhone. I obviously have a tableview to

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.