1

I have this simple coffescript

$(document)
   .ready -> $('body') .css -> 'background-color':'black'

it's compile to

(function() {
  $(document).ready(function() {
    return $('body').css(function() {
      return {
        'background-color': 'black'
      };
    });
  });

}).call(this);

after that i have some console error no method 'replace', what is wrong? Much thx for help.

2

1 Answer 1

2

Change your CS to

$(document)
   .ready -> $('body') .css 'background-color':'black'

So that the argument passed to css is {'background-color': 'black'} instead of a function.

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

Comments

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.