Co2 Co2 - 10 months ago 81
CoffeeScript Question

noConflict in Coffeescript?

I have the following JavaScript for a datepicker in my rails application but I want to use coffeescript and I am wondering how to implement no conflict on this function in coffeescript?

var $j = jQuery.noConflict();
initialDate: '02-12-1989',
format: 'dd-mm-yyyy',
disableDblClickSelection: true

Also the above works but I have to refresh the page before it does. Any advice on both? Thanks.


Here's what it might look like in CoffeeScript.

$j = jQuery.noConflict()
$ ->
    initialDate: '02-12-1989'
    format: 'dd-mm-yyyy'
    disableDblClickSelection: true

When it runs in the browser it's still running as JavaScript so the functionality jQuery.noConflict() offers is still going to be there.