0

Trying to figure out why this sublime text snippet won't render from the keyboard shortcut:

<snippet>
    <content><![CDATA[
var url = '';

var jqxhr = $.ajax(url)
    .done(function() {
        console.log('success');
    })
    .fail(function() {
        console.log('error');
    })
    .always(function() {
        console.log('complete');
    });
]]></content>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <tabTrigger>jsajax</tabTrigger>
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <!-- <scope>source.python</scope> -->
</snippet>

If I edit it down to a simple url variable, it will render fine, so I'm guessing there's something invalid in the ajax request, but I can't figure out why. I'm using sublime text 3

1 Answer 1

4

You have to escape the dollar sign: \$

Sign up to request clarification or add additional context in comments.

1 Comment

This is incredible...!! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.