How do I do the following in CoffeeScript?
$( function() {
$('input#username').keyup( function() {
var username = $('input#username').val();
...
|
I have two (slow loading) data sources. I can start working on data source 2 as soon as it's loaded, but need the data from both 1 and 2 to ... |
CoffeeScript seems like a promising new technology, and I'll definitely give it a try in my next project.
It seems like jQuery can be used easily with CoffeeScript as is - however ... |
$.ajax '/',
type: 'GET'
dataType: 'html' error: (jqXHR, textStatus, errorThrown) ->
$('body').append "AJAX Error: #{textStatus}"
...
|
Forgive the CoffeeScript newb question.
I want to pass two anonymous functions as arguments for jQuery's hover, like so:
$('element').hover(
function() {
// do stuff on mouseover
},
...
|
Something like...
$('.foo').live 'click', ->
setTimeout (()->$(this).parent().hide()), 5000
Thanks for any help!
|
When writing CoffeeScript in TextMate and wanting to use a 3rd party Javascript library like jQuery or Raphael there is a need to add a "require" like so:
$ = require 'jquery'
This ... |
|
Ladies & Gentlemen,
My Goal:
Learn CoffeeScript by porting a jquery widget to coffescript.
Following the excellent jQuery widget introduction, I have ported the example code to CoffeeScript:
http://bililite.com/blog/understanding-jquery-ui-widgets-a-tutorial/
from:
var Green5 = {
...
|
How can I properly use jQuery and CoffeeScript? All of the examples that I have seen thus far compile the CofeeScript at runtime in the browser; this is not ideal. Normally, ... |
I can use JSDOM's 'scripts' option to load jquery for scraping. However I was wondering if it was possible, and also better or worse, to use node's own require mechanism now ... |
I have some scripting that modifies my web application.
What it basically does is:
- Add dynamic elements to the DOM
- Resize some DOM elements to fit the window height and other stuff...
So, ... |
I can't for the life of me figure this out or find a solution online. I am trying to figure out how to write a script in CoffeeScript from jQuery ... |
I have the following code which I am try to write with coffeescript.
$.ajax {
type: 'GET'
url: '/dashboard'
success: (response) ->
$('.loading_row').remove()
dataType: ...
|
I have some coffeescript like the following:
class foo:
@bar = 'bob loblaw'
processRows: ->
$("#my-table>tr").each ->
...
|
I want to convert a jQuery function written in JavaScript into Coffeescript, which gets two functions as parameters. I'm new to Coffeescript and I'm a little stuck here. The original function ... |
Just trying to learn and confused on how to do the following. Thanks!
$.each($(".nested-fields"), function(intIndex) {$(this).find(".set").html(intIndex+1);;} );
Thank you again.
|
I know I can set the call to synchronous, or wrap everything preceeding in the complete() callback, but it seems inelegant. Here's what i've got:
_loadShader: (url) ->
...
|
I'm trying to use the jasmine-jquery plugin: https://github.com/velesin/jasmine-jquery. In the documentation it says to:
Simply download jasmine-jquery.js from the downloads page and include
it in your ... |
I have a coffeescript file called shapes.coffee:
jQuery ->
offset = $('#drawing_canvas').offset()
mouse_vertical_position = -Number(offset.top)
mouse_horizontal_position = -Number(offset.left)
canvas = document.getElementById("drawing_canvas")
context = canvas.getContext("2d")
container = ...
|
I want to put more than one jquery extension in the same file. I have the following in one file:
do($ = jQuery) ->
$.fn.addAlternatingStyles = ->
...
|
I am trying to make ajax call with coffescript and jquery and update form input type with result, but my input gets updated with [object XMLDocument] instead returned text
Here is coffescript ... |
Jasmine Test:
describe 'Toolbar', ->
beforeEach ->
jasmine.getFixtures().fixturesPath = "../spec/javascript/fixtures"
loadFixtures("canvas_fixture.html")
describe 'Rectangle Button Click', ->
it 'adds the selected class ...
|
I'm new to javascript and starting the mix javascript + jquery + coffeescript all together is not easy for a newbie like me...
I've created a very simple sortable list and I'd ... |
i'm trying to apply the "refresh" trigger in my coffeescript code, but I don't find the correct syntax:
in standard jquery, it would be: $('.milestone_chain').sortable('refresh')
What would it be in coffeescript, knowing that ... |
I appreciate how the CoffeeScript syntax can help writing callbacks functions and make jQuery syntax much lighter. However, I'm still bothered by the classic $(".foo") construct: there are 6 symbols for ... |
I am a newbie in Coffeescript and would like to use the delegate() method in jquery 1.6.4. The method signature is .delegate( selector, eventType, handler ). How do I go about ... |
Related, but not a fix: jQuery issue - #<an Object> has no method
I'm getting an error Object [object Object] has no method 'effect' when I try to use the effect ... |
I have 50-100 objects in memory client-side. I need to search them without tags, just text searching every field of the object and finding matches or partial matches.
What is the ... |