Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML External Links Fail

Status
Not open for further replies.

peterd51

Technical User
Feb 22, 2005
109
0
0
GB
Hi,


I have in my <body> an external link and when I click on it, the URL changes to 'my web page' plus the one I'm trying to get to. For example...

<A HREF=" here to visit Tek-Tips.com!</A>

Would show 'www.mypage/ and get an error 404.

I've tried adding various targets "_blank", "_new", etc, but I haven't found a cure yet.

All I've found around the net is that a basic link should work.

Could it be my hosts server blocking forward access to other web-sites?

All local links between my pages work OK and everything passes the validation process for HTML and CSS.

Any ideas please?

Regards
Peter
 
Hi

I saw such errors when the URL's protocol was incorrect in the [tt]href[/tt] attribute, for example the colon ( : ) or one of the slashes ( / ) were missing.

If you are sure your URL's protocol is correct, then probably some JavaScript code is messing it up after the page was loaded. Try to leave out the [tt]http:[/tt], hoping that will confuse such JavaScript and will leave it untouched :
HTML:
<a href="//[URL unfurl="true"]www.tek-tips.com">Click[/URL] here to visit Tek-Tips.com!</a>

But to be able to say it for sure, we will need to see that entire page and the script used in it. Is it publicly accessible ?

Feherke.
feherke.ga
 
everything passes the validation process for HTML and CSS.

"Validation" of HTML / CSS is only a 'spelling and grammar check' for the source code NOT a check for "working code".

Your description of the problem suggests that the links on the page are 'page relative URIs' rather than being absolute URLs


Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
Hi,

thanks for the replies.

My main web-site isn't quite finished so I've copied the offending parts onto a 'spare' site that I have.


The first link to Irfanview highlights the problem of getting my URL and the target URL linked together.

The second part is the shipping map from MarineTraffic, script and link provided by them to show live shipping in the specific area of the map.

The map loads but there's no ships shown...this may be a problem at their end but I wanted to make sure I'd not done something wrong before bothering them.

Regards
Peter
 
Fix the DTD and it will be fine.


HINT you need a '<'

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
And ....


If you are feeling a bit dumb right about now, ... ... Don't, ... ... 'cause we have ALL done things like that.



Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
Hi Chris,

thanks, but I still couldn't see it.

I must admin that I thought I'd reset it after poking around trying all sorts of things but I'd actually left it right after one of my 'pokes' so the line was a bit mixed up.

However you made me do another google search for 'html target' and when I compared the example given with mine I finally noticed a missing ':' after 'html'.

That part's working now, I'll contact MarineTraffic to see where I've got their code wrong.

Regards
Peter

 
A 'proper' DTD
HTML:
<!DOCTYPE html>


Your DTD was
HTML:
!DOCTYPE html>




Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
hi Chris,

sorry, I wasn't looking way up there!

It's in place now and I don't recall changing it.

I have a html template that I used for every page and it's in place there so I'm not sure why you found it was missing.

Thanks for your help.

Regards
Peter
 
Yeah, I put many of the odd things that happen down to;

"There's a computer involved"




Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
hi Chris.

yes, you might also guess that I'm not a programmer, I just poke around a bit.

My old site was still using html from before v4.0...

and I'd never used any CSS until a week ago. It should be more up to date now.

My main site, (photos, mostly ships, a few aircraft) seems to be working (as far as I can tell)...

if a user has certain versions of Firefox the link to marinetraffic.com shows the map but doesn't show any ships...

a detail tucked away in the deepest part of their site!

I've added a direct link to their site, bypassing their JavaScript, for any users who get that problem.

My sharesim site has been put back to bed until next time I need it.

Thanks for your help.

Regards
Peter
 
and I'd never used any CSS until a week ago. It should be more up to date now.
Doesn't really matter about CSS "being up to date", no one is going to force any one to use the very latest, you could still use HTML 4.01 if that is all you need.

However, for the sake of legibility and usability, you might want to rethink the white text on turquoise, :)

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
Hi

One thing would be nice to change anyway : the content should be between [tt]p[/tt] tags, not the [tt]p[/tt] tags between content. ( No, not for the visitors ( either humans or robots ), but for your future self when you will decide to add more CSS. )


Feherke.
feherke.ga
 
Hi Chris,

I was trying to find colours that worked OK and I can read those even with my poor eyesight. Something I could play around with later... the background could do with being a bit darker. I used to have a decent colour chart for HTML but I haven't seen it for a few years, kicking around my computer room I guess. The on-line colour charts that I found seem to mix up the colours too much for me to 'see' anything that I like.

Hi feherke: the P tags are only there to create a double space between paragraphs. Years ago I'd just bung a <p><&nbsp;><p> in there to do it. Looking at an online CSS tutorial I saw the setup that I'm using and I copied it. Hopefully I'll be keeping the site as simple as it is. It's only a 'hobby' site for me and once I get it fully working the only likely additions will be new photographs.

Thanks for the input, things to think about and play with when the weather gets bad and I can't get to the beach!

Regards
Peter
 
My (also poor) eyesight was the reason I mentioned it :) I have 'issues' with low contrast colours. Conclusive proof that we are all unique, ... ... Just like everybody else.

Hi feherke: the P tags are only there to create a double space between paragraphs. Years ago I'd just bung a <p><&nbsp;><p> in there to do it.

Yeah, that's a rather 'old' way, yet one still used by just about every content management system editor because it is so simple to implement.

The 'modern' way for 'static' designs would be to increase the top or bottom margins of an element to increase he gap between them.

and play with when the weather gets bad and I can't get to the beach!
Move to Blackpool and that 'problem' will cease to exist :)


Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
hi Chris,

I've been to Blackpool a few times, ships tend to be a long way out there...

I had to put the site on a back burner for a week as I was making changes to a VB program that I use every day, just about finished that now.

I'll be doing some more on the site over the next week or so, new pictures to add as the weather's been great here...sunny, not much wind and cool enough to cut down the heat-haze.

I'll be looking at the back-ground colour again it should have been a bit darker but that was where I got to and moved on to do other things. I also need to look at those P tags, and I'm not so sure about keeping it to a strict format, pretty much fixed line lengths as it is now. It could do with being a bit more flexible.

Thanks for your advice.

Peter


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top