As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I've done some research into server push with javascript and have found the general consensus to be that what I'm looking for lies in the "Comet" design pattern. Are there any good implementations of this pattern built on top of jQuery? If not, are there any good implementations of this pattern at all? And regardless of the answer to those questions, is there any documentation on this pattern from an implementation stand-point?
I wrote the plugin mentioned by Till. The plugin is an implementation of the Bayeux protocol and currently supports long-polling (local server via AJAX) and callback-polling (remote server via XSS). There is a Bayeux implementation for Python called cometd-twisted that I have heard my plugin works with, but I have not verified this. I have tested and verified it works with cometd-jetty and erlycomet which has a jQuery Comet example included. There is more info on my blog and the current code with a basic chat example can be found on its google code page. Hope this info is helpful and feel free to contact me if need any further help with the plugin.
Someone built a client for Comet using jQuery. I don't know if it's any good though. I've read about Comet and heard about all the good it can do, but I have never gotten around to using it. Just had no time and no use case on any of my current projects.
I totally forgot to add a link as for implementing comet.
There is Comet Daily and they have a comparison online. The comparison emphasizes on maturity of the different implementation. It's pretty interesting and should get you started.
Hope that helps!
Check out the Ape Project for a complete client and server side solution that implements the comet pattern.
A description of the pattern: http://ajaxpatterns.org/HTTP_Streaming
Comet is a great solution, and there are all kinds of implementations. Which one depends on your needs.
We've implemented a solution for IIS/ASP.NET, WebSync. It includes the javascript client, which plays nicely with jQuery. Technically, since it's the Bayeux protocol, any Bayeux client should work just dandy. The same protocol can also be found in the dojo library.
For more detail, you can see the spec for the Bayeux protocol.
I have a very simple example here that can get you started with comet. It covers compiling Nginx with the NHPM module and includes code for simple publisher/subscriber roles in jQuery, PHP, and Bash.
http://blog.jamieisaacs.com/2010/08/27/comet-with-nginx-and-jquery/
A working example (simple chat) can be found here:
http://cheetah.jamieisaacs.com/
Look at socket.io. Trust me. This is exactly what the doctor ordered.
http://socket.io
Stream data with Node.js
If you're using JQuery, I'd recommend jquery-stream. I'm currently using jquery-stream on a project and so far its been reliable, well-documented and has an active Google code project.
http://code.google.com/p/jquery-stream/
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm trying to decide between Sencha Architect 2 and Wavemaker. They both seem very similar. Of course Wavemaker is completely open source, and Sencha is only partially open source. For this reason I'm leaning towards Wavemaker, but given the learning curve with either, I'd hate to find myself with less options later on, just because I tried to save some money. Here are my main concerns.
1- I want to be able to sell my application without giving away my source code.
2- Productivity of course is paramount. Are they both about the same?
3- Database development tools.
4- Easy of deployment and hosting options.
Opinions either way are much appreciated.
wavemaker is for me best tool for now..
1.on javascript can use some tools for obfuscate code
2.WYSIWYG..visual tool with cool ajax widgets drag and drop and offcourse all free
3.have is model part for can create your db
4.cloudfoundry
Full disclosure: I work for VMware on WaveMaker.
I felt compelled to correct a few things from Rene’s post. WaveMaker is not strictly a backend framework. WaveMaker is a visual, drag-and-drop development tool. Applications created with WaveMaker contain a backend framework (Java, Spring) and a frontend framework (JavaScript, Dojo). Developers enhance their UI by writing JavaScript code.
The comparison to GWT implies that UI development in WaveMaker is done using Java. Although Java is part of the WaveMaker framework, developers do not use Java code to enhance UI functionality. The back-end code is Java, which is used to access databases and other backend services. In most cases WaveMaker developers do not need to modify the Java code. Since WaveMaker produces standard Java/Spring applications it’s easy for a Java developer to extend the backend functionality.
This question doesn't make much sense to me. Are you comparing just the IDE-s?
Anyway, your options look like very different things. One is primarily a front-end framework and another one a back-end framework. One produces Java apps, another one JavaScript. Maybe you should compare Wavemaker against Ext GWT instead, which is Java-based.
Given your point 3, your choice should be straight-forward as there are no database development tools in any of those Sencha front-end development tools that you seem to be referring to. There might be something in Ext GWT, but I'm not at all familiar with that.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am .NET (do most of my work in ASP.NET WebForms) developer. But I am not limiting myself to that framework only and read and try to learn new stuff from time to time.
Lately I noticed a lot is happening in Javascript world. I'm familiar with jquery/UI and calling web services from client side. But lately I see a lot of new frameworks written in Javascript. I really don't know why so many are created lately. Can anyone enlighten me why is that happening? What are the differences between different frameworks. When should I use/not use them? For example node.js is something totally weird for me. Writing server side code in JS? Writing HTTP servers in JS (or maybe no one really does it?). Creating client side UI on JS only? I really don't get it. Add to this at least 5 templating frameworks and my head is about to explode :)
Atwood's law:
Any application that can be written in JavaScript, will eventually be written in JavaScript.
The real story is: nodejs (or v8) allows developers to write applications in Javascript that can be executed outside a browser. This makes Javascript as powerful as Python or Ruby. Nodejs was adopted faster than any language in history, because many developers already know Javascript. Suddenly it's possible to write applications in Javascript, so we are in a gold rush of development. Many from the Ruby community (who are early adopters) tried nodejs, so it inherited a culture of sharing libraries under permissive licences.
I don't use the client-side/server-side language because it's confusing and a false dichotomy.
I think all the javascript server side libraries are now coming out because of Google's V8; The highly efficient JS engine that Google made for Chrome. It compiles the JS codes and therefore runs its pretty fast.
It was not too long ago that V8 was released.
It makes it easy to run js without a browser efficiently.
The biggest downside of node.js is probably that a fatal error will crash the entire http daemon. So one visitor can bring the entire site down unless a lot of care has been taken.
I think the biggest advantage of js-server-side like node.js is that you can run the same code on server and on browser. This is particularly useful for form validations, for example.
As compared to PHP, node.js also provides the advantage of being able to make non-blocking calls. In fact with node.js its really hard to make any blocking calls.
I wouldn't call node.js a framework though, I see it more like an essential library for which a framework still has to be made (or does one exist already?).
Linkedin is built on node.js and they seem to be very pleased with it. However their site seems to be quite backward to me.
All the fuss about JS is because of the great UI experience the user can get. Instead of the user waiting for the page to refresh every single time they do something, the results are almost instantaneous. I agree with #Karoly Horvath's comment. JQuery may seem weird at first, but its because of the unknown, it's great to work with once you are used to the syntax. Getting back to the user experience, if your page takes forever to load/reload, the users will rather use another site. Your question is not really fit for Stack Overflow, but im sure you will find some additional answers and opinions in the chat sites available on SO. Good luck.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I'm wanting to create a web app where people can collaborate with a specified image.
For example, if you take a look at this basketball app
https://market.android.com/details?id=com.canica.apps.basket&hl=en
I'm envisioning something similar where people can log in, draw plays etc,
I want updates to happen in real time, so that other people logged in as a team see what others are 'drawing'.
I was thinking of extending a html canvas drawing app and adding network communication, but I'm not sure where to start looking.
My question is - What technologies should I be looking at for pushing the data out to the users?
Does anyone have suggestions?
You've almost answered your own question, especially with your use of HTML5 and JavaScript tag.
You should take a look at WebSockets (what, what and why).
WebSockets allow for bi-directional communication between any client and server. Originally only available in web browsers via JavaScript but there are now a number of WebSocket client libraries available which mean that whilst you can develop with browsers in mind there's no reason why you client can't be any device.
A quick search came up with this example. There is also this iPad/iPhone application.
There also appears to be a video tutorial that uses node.js and socket.io here:
http://wesbos.com/html5-canvas-websockets-nodejs/
If you don't want to worry about installing and maintaining your own realtime infrastructure that also deals with fallback techniques for older web browsers then you might consider using a hosted realtime web service.
XMPP might be something to look into. A great book about interacting with XMPP servers from the browser is Professional XMPP Programming With JavaScript and jQuery.
It's a pretty soft introduction and I think there might even be a chapter in there that covers implementing something similar.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I want to build a IRC client in Javascript, maybe using jQuery, but I am struggling a little in getting started.
I have looked a little at http://qwebirc.org/ and how they are doing things, but they have A LOT of code doing specific things only to their project.
I have searched the net for a short example, that lets me start, so I could build further. Any suggestions on where to look, or someone who can come up with an example?
The backend is a more important consideration than whether or not you use jQuery or anything like that. As you may be aware, you can't really write a full browser-based IRC client in Javascript; the JS merely uses XMLHTTPRequest to collect data from an IRC-connected server-side socket implemented in something like PHP.
To that effect, you might have a lot more luck looking for some kind of PHP IRC library (like this: http://sourceforge.net/projects/phpsmartirc/) and then setting up the client frontend separately which will alleviate, to some extent, the "LOT of code doing specific things only to their project".
Here's an open source project that has made some progress to making a AJAX IRC client:
https://github.com/naneau/node-irc-client
Elliott, the backend no is more important consideration than interface frontend, but your sugestion is a good ideia for a expert programmer begin a Ajax IRC Client!
PHP Smart IRC is a package PEAR that aims to implement IRC Protocol communication via PHP sockets.
The advantage is that the implementation of commands is ready, there is no need to start this class from the begin.
Any attempt will merely be using AJAX as an intermediate step between an IRC client/server running on the hosting web server.
Using jquery.ui.chatbox as the interface with messages being sent and received via AJAX would give you the flexibility to implement it in any number of ways e.g.:
IRC
XMPP
PHP/MySQL
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
For scripting on web browsers, the only option now is using javascript.
I wonder if Ruby ever could make it to the web browsers?
It's highly unlikely cause MS doesn't have any reasons for letting Ruby to become first class citizen, wouldn't that be bad for their current platform? I don't know how Apple sees it.
If Ruby can't be first class citizen in the browsers, how likely is it that a add-on could be installed on the browser, letting the browser execute Ruby also. In that way, we programmers could just use Ruby instead.
Your best bet is probably a "language converter" like:
http://rb2js.rubyforge.org
Honestly though I would just bite the bullet and learn Javascript. A plug-in could be created, but it would never catch on: businesses won't inconvenience their customers just so that their programmers can use the language of their choice.
I don't like JS that much. For a scripting language its way too much verbose, it suffers from bad design decisions that got into the ECMA standard... It has however some nice features which make it unique and powerful.
I wish the web was more agnostic with client-side languages, but its very unlikely, sadly.
If you want something that feels like Ruby you may try CoffeeScript. You write your code in CoffeeScript which then gets turned into JavaScript. It borrows a lot of ideas from Ruby and Python which makes a great mix.
http://jashkenas.github.com/coffee-script/
I am personally enjoying it very much.
It may not be in the near future or it may never be implemented as the browser scripting language. But people are playing around with that idea. Check out rubyinside.com, they seem to have a working demo. The last time I checked the demo page crashed the browser :(
But don't loose hope yet ;)
It's not exactly using Ruby as a replacement for Javascript, but you can run Ruby on Silverlight (and Moonlight, the Linux implementation of Silverlight).
No one can tell the future, but I'd say it's incredibly unlikely. Browser vendors aren't likely going to want to support multiple client side scripting languages (see the death of VBScript in the browser). Javascript fills the client side niche already so there's no reason to vendors to introduce a new language just so that there is an alternative syntax. 3rd party plugins aren't really a good solution either because users get no benefit from installing it (unlike something like Flash which can offer functionality that HTML/Javascript can't).
There are some Javascript libraries that try to emulate a Ruby style of coding -- for instance, JS.Class.