Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- var Server = Pusher.new('api_key', 'channel');
- // option 1
- Server.bind('event',function(data){
- console.log("data received");
- });
- /* option 2
- Re Build your element
- */
- Server.bind('event',function(data){
- var strong = $("<strong>",{
- text: data.user.name
- }),
- link = $("<a>",{
- href:"#"
- });
- link.append(strong);
- $("#box_"+data.app.name+"_app_"+data.name).html(link);
- });
- /* Option 3
- Build on request.
- */
- Server.bind('event',function(data){
- $(data.tag).html(data.html);
- });
- ...
Add Comment
Please, Sign In to add comment