Hi guys, thanks for reading my question!
So there is a software project that I am working on that requires me to resolve relative URLs and I thought I had it down pat until the client contacted me saying that it doesn't work for some sites. The client sent along one of the webaddresses where this occured and sure enough it fails there even tho both FF and IE succeed there. That makes me think it's a problem with my software.
Now my question is how to merge base paths and relative paths for websites?
Having read the following RFCs:
- -
I came to the conclusion that the following description is how to resolve relative URLs:
Step 1: Take the directory the currently visited webpage is at.
For example: " is where the page is at, then I should remember to use " as a base absolute path.
So when that index.htm has a picture in it as such:
img src="images/mypic.jpg"
then the full URL of this picture should be:
When there is a BASE HREF="" tag then that should overwrite the webdirectory the webpage is in.
For example: base href=" then the URL should be:
rather than
And this works for every site except this one site but it does work for FF and IE (even tho they resolve different URLs for the pictures that both work!) and it is bugging the living hell out of me.
Now I am going to give you some fictional data as the site concerned is a pornographic site and I do not think it is appropriate to post that here, but it will be accurate for the paths.
----------------------------------------------------------
Website: Base HREF: Image: /promo/089_Skyline/pics/01.jpg
----------------------------------------------------------
This leads me to believe that the images should be found at:
Now, even tho this works for every other site in existance, it doesn't for this one.
IE can load the images and says the URL should be: FF can load the images and says the URL should be:
Now my question is, where am I going wrong with this?
BobbaFet
So there is a software project that I am working on that requires me to resolve relative URLs and I thought I had it down pat until the client contacted me saying that it doesn't work for some sites. The client sent along one of the webaddresses where this occured and sure enough it fails there even tho both FF and IE succeed there. That makes me think it's a problem with my software.
Now my question is how to merge base paths and relative paths for websites?
Having read the following RFCs:
- -
I came to the conclusion that the following description is how to resolve relative URLs:
Step 1: Take the directory the currently visited webpage is at.
For example: " is where the page is at, then I should remember to use " as a base absolute path.
So when that index.htm has a picture in it as such:
img src="images/mypic.jpg"
then the full URL of this picture should be:
When there is a BASE HREF="" tag then that should overwrite the webdirectory the webpage is in.
For example: base href=" then the URL should be:
rather than
And this works for every site except this one site but it does work for FF and IE (even tho they resolve different URLs for the pictures that both work!) and it is bugging the living hell out of me.
Now I am going to give you some fictional data as the site concerned is a pornographic site and I do not think it is appropriate to post that here, but it will be accurate for the paths.
----------------------------------------------------------
Website: Base HREF: Image: /promo/089_Skyline/pics/01.jpg
----------------------------------------------------------
This leads me to believe that the images should be found at:
Now, even tho this works for every other site in existance, it doesn't for this one.
IE can load the images and says the URL should be: FF can load the images and says the URL should be:
Now my question is, where am I going wrong with this?
BobbaFet
Code:
if not Programming = 'Severe Migraine' then
ShowMessage('Eureka!');