INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

HTML External Links Fail

HTML External Links Fail

(OP)
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="http://www.tek-tips.com">Click here to visit Tek-Tips.com!</A>

Would show 'www.mypage/http://www.tek-tips.com' 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

RE: HTML External Links Fail

Hi

I saw such errors when the URL's protocol was incorrect in the href 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 http:, hoping that will confuse such JavaScript and will leave it untouched :

CODE --> HTML

<a href="//www.tek-tips.com">Click 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

RE: HTML External Links Fail

Quote:

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

http://webmaster-talk.eu/cat-quick-tips/20-qt-uri-...

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.

RE: HTML External Links Fail

(OP)
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.

www.sharesim.co.uk

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


RE: HTML External Links Fail

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.

RE: HTML External Links Fail

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.

RE: HTML External Links Fail

(OP)
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

RE: HTML External Links Fail

A 'proper' DTD

CODE --> HTML

<!DOCTYPE html> 


Your DTD was

CODE --> 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.

RE: HTML External Links Fail

(OP)
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

RE: HTML External Links Fail

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.

RE: HTML External Links Fail

(OP)
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, www.padco.net (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

RE: HTML External Links Fail

Quote:

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.

RE: HTML External Links Fail

Hi

One thing would be nice to change anyway : the content should be between p tags, not the p 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

RE: HTML External Links Fail

(OP)
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

RE: HTML External Links Fail

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.

Quote:

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.

Quote:

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.

RE: HTML External Links Fail

(OP)
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


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close