views:

293

answers:

4

AJAX is a pain in the ass because it essentially means you'll have to write two sets of similarish code: one for browsers with JavaScript enabled and those without.

Not only this, but you have to connect JavaScript events to hook into your models and display the results.

And if all that weren't bad enough, you need to send an address change with the request, otherwise the user won't be able to "click back" correctly (if confused look at what happens to the address bar when you click links in GMail).

We're searching for something that had the foresight and design goals with all these concerns in mind.

Performance and security are also obvious major concerns.

We love config-based systems as well, where you don't have to write a lot of code you just drop it into an easily read config format.

It's like asking for the holy grail right?

A: 

Two approaches to this problem generally. One is for the framework to try and do it all, like Microsoft's ASP.NET with its Ajax toolkit. This includes server side controls that produce Ajax functionality with all client- and server-side code generated for you. For example, their UpdatePanel control allows for partial page updates via an Ajax call. However, it is not universally popular as a framework in general because their Page and Control models are sometimes seen as too heavyweight and overbloated.

A second, "slimmer" approach would be to separate the concerns. Let jQuery or a similar library deal with cross-browser inconsistencies and the client side of the Ajax call, and use a simple lightweight server-side web framework, such as Groovy on Grails or Microsoft ASP.NET MVC (there are others as I'm sure people will point out). Any decent framework should be capable of easily producing either JSON or XML data in response to an Ajax call.

As for browsers with Javascript disabled - this is the twenty first century. Do you really have to cater for them any more?

David M
I disable Javascript by default using NoScript at work. Around 5% of users have disabled or no Javascript (according to http://www.thecounter.com/stats/2009/March/javas.php).
kibibu
@kibibu, many users are even without browsers :)
Anurag Uniyal
+3  A: 

Have you given a look to Pyjamas

Quoted from the site

Why should I use it?

You can write web applications in python - a readable programming language - instead of in HTML and Javascript, both of which become quickly unreadable for even medium-sized applications. Your application's design can benefit from encapsulating high level concepts into classes and modules (instead of trying to fit as much HTML as you can stand into one page); you can reuse - and import - classes and modules.

Also, the AJAX library takes care of all the browser interoperability issues on your behalf, leaving you free to focus on application development instead of learning all the "usual" browser incompatibilities.

Anurag Uniyal
A: 

Yes, the NOLOH PHP Framework (the site itself was written in NOLOH) is that holy grail. NOLOH was developed from the ground up to address these issues. You develop in a single language on the server-side and it takes care of the rest. No need to worry about AJAX, or cross browser issues. NOLOH's been around since 2005 and is being used in various companies large and small. It significantly outperforms the competition in performance due to it's lightweight and on-demand nature.

NOLOH recently gave a talk at Confoo, the most applicable parts of that presentation to your question are the live examples, and the basic coding.

If you're curious about the power of NOLOH you can also check out this Steve Jobs like one more thing demonstrating the upcoming automatic Comet.

Disclaimer: I'm a co-founder of NOLOH.

Enjoy.

asnyder
This sound an awful lot like an add, comes with no acknowledgment of a relationship between you and the tool suggested, and is only one of several such answers (you did [mention the the relationship here](http://stackoverflow.com/questions/2625405/recommend-a-php-framework-for-new-php-programmer/2627077#2627077).) Pursuant to [a recent meta discussion on this issue](http://meta.stackoverflow.com/questions/57497) I recommend editing these post to own up. Quickly would be good.
dmckee
Post was flagged due to lack of disclaimer. I (the author) am a co-founder of NOLOH and mistakenly forgot to add a disclaimer. I will add a disclaimer to the post as soon as my reputation is restored.
asnyder
@asnyder - I think you're going about it backwards. You'll need to add a disclaimer, as noted in the FAQ to stop garnering down votes and flags. I'd, umm ... make haste :)
Tim Post
@asnyder: If one more person flags this as spam, it will be deleted. I'd suggest you add a disclaimer, and then I can clear the spam flags.
Michael Myers
I can't add a disclaimer due to you guys constantly downvoting it. It's destroying my reputation. I'm in contact with Jeff Atwood and am trying to sort this out. Please upvote it so I can edit it. When the post was originally created I had significant reputation, now my reputation is such that I can't edit it. Please have mercy. I've been frantically answering questions to restore my reputation past 10. Please upvote and help. Once I'm back to 10 I can edit it and add the disclaimer.
asnyder
If anyone has edit ability, please add the line:"Disclaimer: I'm a co-founder of NOLOH" to the bottom. Please.
asnyder
@asnyder: I was under the impression that editing one's own posts did not require any reputation whatsoever. I've upvoted temporarily so you now have 13 rep; does it work now?
Michael Myers
@mmyers Thankfully, I somehow got above 10 reputation in the past few minutes and was able to add the disclaimer. Jeff said he would remove the spam flag tomorrow.
asnyder
@mmyers Thank You. Yes, that worked.
asnyder
@mmyers now what can I do about all these downvotes related to the spam flag? Will they go away once the spam flag is removed? I know that Jeff recently game me an upvote to help until he can get to it.
asnyder
I have cleared the flags from this post. It would probably be a good idea to go back through your old posts and add disclaimers if necessary to keep this from happening again; I see you've had several answers deleted as spam in the past.
Michael Myers
@mmyers I'm not aware of any other posts being flagged as spam. Could you please direct me to these posts? I usually make an effort to ensure the disclaimer is there when necessary.
asnyder
None are currently flagged as spam, but I see that six of your old answers were deleted as spam at one time or another.
Michael Myers
@mmyers I was never notified of any spam related posts. If it's not too much trouble could you e-mail me a list of these posts?
asnyder
A: 

The jQuery BBQ: Back Button & Query Library aims to help with ajax "back button" issue. You might check it out if you're considering jQuery for your ajax functionality.

Craig