views:

32

answers:

3

I find myself doing a ton of jquery these days so I started to abstract out some of the common things I do into snippets. I look forward to sharing these with the community, but i'm running into an issue right now.

The literals in snippets are defined by adding dollar signs ($) around the name of the literal to delimite where the value you would like to provide will go. This is difficult because jQuery uses the dollar sign notation in order to use a lot of it's functionality.

Does anyone know the escape sequence for snippets so I am able to use the dollar sign, and have my snippets still function?

+1  A: 

To have a literal $ try doubling it: $$

Ahmad Mageed
A: 

More of a side note, but don't forget you can use jQuery instead of $

Dan Heberden
A: 

although the jQuery response is valid, it's a nicer syntax to use the $ notation.

I've found an answer. Making the $ character a literal with a default value of $.

<Literal Editable="true">   

      <ID>dollar</ID>            <ToolTip>replace the dollar sign character</ToolTip>            <Default>$</Default>            <Function>            </Function>          </Literal>  
SyntaxC4