Saad A
Saad A

Reputation: 1147

Coldfusion: Empty Link href="#" Error

I am using Adobe Coldfusion Builder 3 for my CFWheels Coldfusion project.

As you know to output a variable in coldfusion you do something like this;

#varaible_name#

However I want to use a empty link

<a href="#">link</a> 

and using it give me an error;

Invalid CFML construct found on line 23 at column 46.

I am currently using

<a href="javascript:void(0)"></a>

which I read is considered bad practice.

Is there any other alternative for this functionality?

Upvotes: 0

Views: 316

Answers (1)

James A Mohler
James A Mohler

Reputation: 11120

To escape the #, you need to double it up

<a href="##">link</a>

Note: this only applies if the code is inside of <cfoutput> tags. If your link is outside of <cfoutput>, then it is left alone.

For additional examples, see: Coldfusion Query Anchor Element by Id

Upvotes: 6

Related Questions