I am looking for an alternative to the html <base>..!

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
iceslice
Forum Newbie
Posts: 2
Joined: Fri Jul 04, 2003 4:03 am

I am looking for an alternative to the html <base>..!

Post by iceslice »

Im writing a personal site to strip, for lack of a better term, the top few posts from a few of my favorite forums. The problem that i've encountered is that each of these forums uses non-absolute refrences, so after the code is stripped from site1.com, the link would go from site1.com/post1 to mysite.com/post1, which is the incorrect link. The only solution i've found so far is the <head><base href="site1.com" /> tag, which can not be used multiple times for multiple sites. Not being able to put multiple sites worth of information on one page would of course defeat the purpose of coding this to being with.

Are there alternatives? How about for changing the base of all images? Being able to host the static images localy would greatly increase loadtimes and lower download ammounts (since the server is on my LAN).
I can post examples if needed. Thanks for the input.
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

Try to findout the what tag uses links. (A IMG FRAMESET etc.)
Then try to catch the SRC attribute, and prepand the full path if there is a relative path.
iceslice
Forum Newbie
Posts: 2
Joined: Fri Jul 04, 2003 4:03 am

Post by iceslice »

Im quite a beginner, could you give me a quick example as to how it would be used? I think what you're saying is figure out what code its using ( <a href="link"> </a> ) and then have it put site.com/ in in front of "link"? Or am i wrong?
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

No that's what i'm saying...

(ps: replace site.com with http://www.site.com/ ;) )
Post Reply