Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-06-2012, 04:14 PM   PM User | #1
lucasbrito3
New to the CF scene

 
Join Date: Nov 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
lucasbrito3 is an unknown quantity at this point
HREF / SRC empty

I was trying to run a validation software within our company's website that was developed using coldfusion.

The website renders perfectly but it fails verification. This is the following error i get.



This link is broken. The SRC or HREF is an empty string

HREF=”” or SRC=”” can cause unexpected effects such as traffic spikes or cookie corruption.



The code affected is:



<a href="" onClick="window.open('#to_root#debug_mode.cfm?height=400,width=500,scrollbars=yes');return false;" target="_top" class="globalNavButton">Debug</a>



I have tried to add a # sign to the href target, but that brought an error to the website and the page would not render.

Would anyone be able to assist on how to bypass this issue?



Thank you
lucasbrito3 is offline   Reply With Quote
Old 11-06-2012, 08:47 PM   PM User | #2
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,448
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
The value to put in the href is the address of the page that people without JavaScript are supposed to be taken to if they click on the link.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Old 11-06-2012, 09:40 PM   PM User | #3
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,587
Thanks: 5
Thanked 864 Times in 841 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Generally I’m felgall’s opinion that an anchor must work without JavaScript. But sometimes there are cases where we as developers have no choice other than working with what we’ve got. That said, remove the href completely as apparently it serves no purpose anyway. An anchor is valid without href attribute, too.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 11-07-2012, 01:38 AM   PM User | #4
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,448
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Quote:
Originally Posted by VIPStephan View Post
Generally I’m felgall’s opinion that an anchor must work without JavaScript. But sometimes there are cases where we as developers have no choice other than working with what we’ve got. That said, remove the href completely as apparently it serves no purpose anyway. An anchor is valid without href attribute, too.
Where it isn't intended to work without JavaScript it generally is better to actually add it to the page using JavaScript so that those without JavaScript don't even see it at all.

Of course if it is for an intranet where everyone is confirmed to have JavaScript then having the tag in the HTML without the href makes sense.


Another alternative is to make it a <span> tag rather than an <a> tag.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:29 AM.


Advertisement
Log in to turn off these ads.