i'm developing a web application that focus heavily on ajax. the whole application is just on one page except for the threads that are in traditional pages so they can be indexed.
so i have to have very structured JS-codes and i wonder if they are any frameworks out there that are for ajax-based applications.
eg. codeigniter, cakephp and others i have read about dont focus on this. they just organize regular php code according to mvc.
cause my code starts to be very messy (especially the js code) and i really need some structure here. is there a way to have same mvc + oop structure in javascript? i never heard anyone talking about it. even if i put js codes in separate files, one for each page for example, there are a lot of lines and i feel lost and crunch whenever i have to add some new functionalities.
would be great with suggestions and ideas how to structure this up!
Create an XMLHttpRequest object. Create the function to be executed when the server response is ready. Send the request off to a PHP file (gethint. php) on the server.
It is an open source framework written in PHP, used to develop/create/generate AJAX applications. The fundamental idea behind AJAX (Asynchronous Javascript and XML) is to use the XMLHttpRequest object to change a web page state using background HTTP subrequests without reloading the entire page.
CodeIgniter also has the reputation for being the fastest PHP framework for web development. If a web app revolves around data management, CodeIgniter is the best PHP framework as well. Using CodeIgniter, it is easy to create, insert, update, and delete coding statements without writing raw SQL.
I think you have the wrong mindset about this.
AJAX-heavy sites or applications aren't that much different form their Web 1.0 counterparts in their underpinnings. You still have the same basic components: HTTP Requests and responses. It's just that with AJAX you rarely request a full HTML page. Most of the time you're requesting snippets of HTML, XML, or JSON.
So, just because you'll have a web site/app that is 90%+ AJAX driven doesn't mean you need to throw away existing conventions like MVC and look for something new.
And most modern frameworks have plenty of AJAX stuff baked in: ZF, symfony, cake, etc.
I don't know of any framework, PHP or JavaScript, geared towards what you are asking. That being said, you might get something out of watching High-performance JavaScript: Why Everything You've Been Taught Is Wrong, Designing the Rich Web Experience, and High Performance Ajax Applications, even though they're a couple years old now.
Also, consider digging into projects that are AJAX heavy and seeing how they tick. ExtJS and jQuery UI based applications would be a good start.
You might check out Zephyr. Never used it myself, I just know that it's mainly for AJAX apps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With