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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi all, Im adding some anchors to 1

Status
Not open for further replies.

leadman

Programmer
Joined
Jun 11, 2001
Messages
177
Location
US
Hi all,
Im adding some anchors to a target page like the following:

<A NAME=&quot;anchor1&quot;></a>

Then on the page that points to the page with the above anchor on it ive changed a working link that used to look like this:

<a href=&quot;pagewithanchor.cfm?strProdID=#strProdID#&quot;>

to this:

<a href=&quot;pagewithanchor#anchor1.cfm?strProdID=#strProdID#&quot;>

When I try to load the page with the link on it i get the following error on that line of code:

Just in time compilation error

Invalid token found on line 230 at position 49. ColdFusion was looking at the following text:

?
Invalid expression element. The usual cause of this error is a misspelling in the expression text.

I tried using two #'s (to escape the character) but i still got the same error
 
I think what you are trying to do is:

<CFOUTPUT>
<a href=&quot;pagewithanchor.cfm?strProdID=#strProdID###anchor1&quot;>Link</a>
</CFOUTPUT>

Whenever you want to output a # sign inside a <CFOUPUT> tag, you need to escape it by using ##, otherwise coldfusion is looking for a variable. That's why I added &quot;##anchor1&quot; at the end of the url.

if strProdID = &quot;tshirt&quot;

then ColdFusion would parse the above link as:
<a href=&quot;pagewithanchor.cfm?strProdID=tshirt#anchor1&quot;>Link</a> - tleish
 
Oh, it look like you allready got this answered in another posting. - tleish
 
yes, but thank you. I wasnt sure if that post would be picked up since i didnt get to it right away.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top