Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

caching jQuery selectors

  • Loading branch information...
commit d11384fc08024e0e518c320b480d5178a65e9135 1 parent 488eda1
@addyosmani authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 new_project/app/client/app.coffee
View
8 new_project/app/client/app.coffee
@@ -1,13 +1,15 @@
# Client-side Code
+message = $('#message')
+
# Bind to events
-SS.socket.on 'disconnect', -> $('#message').text('SocketStream server is down :-(')
-SS.socket.on 'connect', -> $('#message').text('SocketStream server is up :-)')
+SS.socket.on 'disconnect', -> message.text('SocketStream server is down :-(')
+SS.socket.on 'connect', -> message.text('SocketStream server is up :-)')
# This method is called automatically when the websocket connection is established. Do not rename/delete
exports.init = ->
# Make a call to the server to retrieve a message
SS.server.app.init (response) ->
- $('#message').text(response)
+ message.text(response)
Please sign in to comment.
Something went wrong with that request. Please try again.