Search code examples
coldfusionjquery-mobilerailocfwheels

Using hyphens in argument names


I am working with CFWheels and jquery mobile and am trying to pass some jquerymobile settings into a linkto call (mainly the data-icon attribute. I never new this before, but it appears to be that ColdFusion doesn't allow hyphens in argument names. My call is as follows:

<cfset contentFor(actioncontent=linkTo(text='Login', route='login', data-icon='check')) />

CFBuilder and Railo throw an error on the hyphen. The Railo error is:

invalid assignment left-hand side (railo.transformer.bytecode.op.OpDouble)

So my questions is: am I correct in saying that hyphens are not allowed in argument names? Also if they are not allowed, is there a way to get the hyphen through or do I just have to create the anchor tag?


Solution

  • try using quotes 'data-icon' or doublequotes "data-icon"

    It's being interpreted as a minus not a dash