Sublime Forum

Jquery user made snippets wont work

#1

I have created a few different snippets but for some reason this one wont work. What am I missing? Any help would be great.

<![CDATA[ $("document").ready(function(){ ${1} }); ]]> docready
0 Likes

#2

you gotta escape your dollar signs $.

0 Likes

#3

Still not working, put the $ and has no effect.

0 Likes

#4
<snippet>
  <content><![CDATA[<script type="text/javascript" src="jquery-1.8.2.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(\$){
  $0
});
</script>
]]></content>
<tabTrigger>docready</tabTrigger>
<scope>text.html</scope>
</snippet>

This one works just fine.

0 Likes

#5

What is source.js for?

0 Likes

#6

Well, to work on js files (which i just realized that is dumb). You may want to remove that line or replace it with text.html

0 Likes