coffeescript « Development « jQuery Q&A

Home
jQuery Q&A
1.addClass
2.alert
3.array
4.attribute
5.browser
6.callback
7.clone
8.Cookie
9.Date
10.Development
11.document
12.dom
13.element
14.filter
15.Firefox
16.flash
17.format
18.html
19.input
20.internet explorer
21.json
22.mootools
23.page
24.performance
25.regex
26.safari
27.selector
28.setTimeout
29.String
30.table
31.Text
32.trigger
33.URL
34.video
35.xml
jQuery Q&A » Development » coffeescript 

1. how do i make a $.get request using coffeescript?    stackoverflow.com

How do I do the following in CoffeeScript?

  $( function() {
    $('input#username').keyup( function() {
      var username = $('input#username').val();
    ...

2. Coffeescript/Javascript design pattern for loading dependent data sources in parallel    stackoverflow.com

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 ...

3. Porting jQuery to CoffeeScript?    stackoverflow.com

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 ...

4. coffeescript with jquery ajax    stackoverflow.com

$.ajax '/',
    type: 'GET'
    dataType: 'html' error: (jqXHR, textStatus, errorThrown) ->
        $('body').append "AJAX Error: #{textStatus}"
    ...

5. How to pass two anonymous functions as arguments in CoffeScript?    stackoverflow.com

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
  },
 ...

6. Pass $(this) into a set timeout function?    stackoverflow.com

Something like...

 $('.foo').live 'click', -> 
    setTimeout (()->$(this).parent().hide()), 5000
Thanks for any help!

7. How do I get TextMate to see "require" expressions in CoffeeScript when compiling?    stackoverflow.com

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 ...

8. How to improve Jquery Widgets written in CoffeeScript?    stackoverflow.com

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  = {
 ...

9. Running JQuery with CoffeeScript    stackoverflow.com

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, ...

10. Using require('jquery') with jsdom?    stackoverflow.com

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 ...

11. jQuery append doesn't see changes?    stackoverflow.com

I have some scripting that modifies my web application. What it basically does is:

  1. Add dynamic elements to the DOM
  2. Resize some DOM elements to fit the window height and other stuff...
So, ...

12. Multiple Functions as Arguments in CoffeeScript    stackoverflow.com

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 ...

13. $.ajax will not work with coffeescript    stackoverflow.com

I have the following code which I am try to write with coffeescript.

$.ajax {
  type: 'GET'
  url: '/dashboard'
  success: (response) -> 
    $('.loading_row').remove()
  dataType: ...

14. Coffeescript 'this' inside jQuery .each()    stackoverflow.com

I have some coffeescript like the following:

class foo:
    @bar = 'bob loblaw'

    processRows: ->
        $("#my-table>tr").each ->
   ...

15. How to convert a jQuery function with two function arguments into Coffeescript    stackoverflow.com

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 ...

16. How would I write this jQuery in coffeescript?    stackoverflow.com

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.

17. Wait for ajax to complete before method return    stackoverflow.com

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) ->   
  ...

18. Adding fixtures to jasmine/ Setting up Jasmine-Jquery    stackoverflow.com

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 ...

19. Refactoring Jquery coffeescript code into seperate files    stackoverflow.com

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 = ...

20. Multiple jQuery extensions in the same CoffeeScript file    stackoverflow.com

I want to put more than one jquery extension in the same file. I have the following in one file:

do($ = jQuery) ->
  $.fn.addAlternatingStyles = ->
    ...

21. coffescript and jquery ajax call    stackoverflow.com

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 ...

22. Coffeescript calling function inside jQuery docment.ready    stackoverflow.com

Jasmine Test:

describe 'Toolbar', ->
  beforeEach ->
    jasmine.getFixtures().fixturesPath = "../spec/javascript/fixtures"
    loadFixtures("canvas_fixture.html")

  describe 'Rectangle Button Click', ->
    it 'adds the selected class ...

23. each loop in coffeescript, jquery    stackoverflow.com

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 ...

24. jquery sortable refresh => what is the correct syntax in coffeescript?    stackoverflow.com

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 ...

25. Can CoffeeScript/jQuery syntax be made simpler?    stackoverflow.com

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 ...

26. jquery.delegate() and Coffeescript    stackoverflow.com

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 ...

27. 'effect' works fine in jsfiddle but not in live code ([object Object] has no method 'effect' )    stackoverflow.com

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 ...

28. Searching through objects, client-side?    stackoverflow.com

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 ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.