Solved

HTML hyperlinks not working

Posted on 2013-11-24
8
175 Views
Last Modified: 2013-11-24
I have a simple html file with a large number of links that work correctly and two that do not (there is no response when the links are clicked - this is not a "Page not found" error). All of the referenced pages are in the same folder as the problem html file.

When I paste the two non-working links into a new html document they work fine, so evidently there is something in the problem html page preventing them from working.

I have attached a copy of the problem html file. The 25 links in the javascript dropdown work correctly; the two links on line 27 ("Portfolio View" and "High Level/QPR View") are the ones that do not.

The problem is probably obvious and I have missed it while staring at it too long. Any assistance would be appreciated - thanks.
indextest.htm
0
Comment
Question by:dgmoore1
  • 4
  • 2
  • 2
8 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39672828
Right now your code renders like below.  The tag font face is not valid and why the empty p tag?

<td>
   <font face="Arial, Helvetica">
      <a href="portfolio_view.htm">Portfolio View</a>
      <br>
       <a href="hpt_high_level_view.htm">High Level/QPR View</a>
    </font>
   <p></p>
</td>

Open in new window

Try changing your code where you get rid fo the font tag, and instead use a class on the td or directly in the a tag.  Then use css to control the font.
<td class="something">
      <a href="portfolio_view.htm">Portfolio View</a>
      <br>
       <a href="hpt_high_level_view.htm">High Level/QPR View</a>

</td>

Open in new window

0
 

Author Comment

by:dgmoore1
ID: 39672893
I'll give that a shot - this is just a mockup page and I wanted to get the basics right before working on the css.

Thanks
0
 

Author Comment

by:dgmoore1
ID: 39672900
OK - I tried your suggestion and substituted
<tr>
      <td class="fontstyle"><a href="portfolio_view.htm">PADD Portfolio View</a>
      <br>
      <a href="hpt_high_level_view.htm">High Level/QPR View</a></font><p></td>
    </tr>

Open in new window

but the link behavior does not change.
0
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 39672913
You have an invalid DOCTYPE which throws you into Quirks mode - not a good thing. This is 2013, so go with an HTML5 DOCTYPE:

<!DOCTYPE html>

Having said that, I can't see a problem. The links on your page seem to work fine (obviously they don't go to the right page because they're relative links)

FYI - the code still has a closing </font> tag and a stray <p> tag for absolutely no reason. Also <font> and <center> are depreacted - drop them from your document completely.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39672940
If it still does not work, just post a link to your sample page.
0
 

Author Closing Comment

by:dgmoore1
ID: 39673037
This is on my company intranet and contains proprietary info, so I can't post a link. I did find the problem, however: the line

<!-- saved from url=(0016)http://localhost -->

which I grabbed from an old page (it was originally used to suppress the browser warning about ActiveX content, but must have been superseded in recent years) was causing the problem. I deleted the line and, voila, everything works.

I'm giving you full points because your suggestions are all helpful, even though they did not address the direct cause of the problem. Live and learn - I gotta clean up some of this stuff!

Thanks
0
 
LVL 43

Expert Comment

by:Chris Stanyon
ID: 39673057
The line you deleted is just a comment. I doudt removing a comment will fix anything.

You still have an invalid doctype and lots of deprecated tags.

Run your site through a Validator
0
 

Author Comment

by:dgmoore1
ID: 39673244
True - it is just a comment. But the links don't work with it there and they do work with it gone. After I verified this - and I find it hard to understand also, but it is what it is - I cleaned up the rest of the html and ran it through the W3 School's validator and it's all clean now. But if I add that <!-- comment line back in, the links stop working again. Go figure.

Thanks for your comments.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How can I put a code without running my other code 4 32
Angular 2 complaining about map file 7 53
How can I   ajax html table  rows? 20 60
html form to write data to csv 24 95
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now