I’m trying to setup a page in Jquery Mobile and Coldfusion8.
My Jquery Mobile links to internal pages look like this:
<a href="#somePage" data-role="button">Click this button</a>
If I run this through Coldfusion like so:
<cfoutput>
<a href="#somePage" data-role="button">Click this button</a>
</cfoutput>
and render the page, I briefly see an “invalid construct” error flashing before the page jumps to normal. I’m already loading scripts at the top, but doesn’t really help.
Any idea how to circumvent this?
Thanks!
EDIT: trying to use “##” now instead of “#”
This is happening because you are within a
<cfoutput>block (you escape a # with another #).The other option is to only wrap the variables that you need within .
So a dynamic link would look something like:
There are advantages and disadvantages to doing it either way (and people that will scream you’re doing it wrong in either case). It’s worth looking at the options for what is best in your situation.