aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes AJAX in Practice: OK for Ajax newbies? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "AJAX in Practice: OK for Ajax newbies?" Watch "AJAX in Practice: OK for Ajax newbies?" New topic
Author

AJAX in Practice: OK for Ajax newbies?

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9351
    
    2

Hello Authors,

I'm a new comer to Ajax. How good does the book help me in getting familiar with AJAX?
[ April 10, 2007: Message edited by: Bear Bibeault ]

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
David C. Crane
author
Ranch Hand

Joined: Oct 13, 2005
Posts: 59
Hi Jothi,

I'd like to think that we get you up to speed pretty well with this book. We start out with a comprehensive review of the asynchronous request techniques at the heart of Ajax, but most of the book is then concerned with how to make those capabilities work with all aspects of your application - interactivity, usability, maintainability, etc.

By the end of the book, we're looking at some fairly complex stuff, but we guide you there step by step.

Dave


---<br />Author of...<br />'Ajax in Action' <a href="http://manning.com/crane" target="_blank" rel="nofollow">http://manning.com/crane</a><br />'Prototype & Scriptaculous in Action'<br /><a href="http://manning.com/crane3" target="_blank" rel="nofollow">http://manning.com/crane3</a><br />'Ajax in Practice'<br /><a href="http://manning.com/crane2" target="_blank" rel="nofollow">http://manning.com/crane2</a>
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9351
    
    2

David,

So this book as well serves a newbie...that sounds good.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61066
    
  66

Yes, the first four chapters of the book are designed to get you ready for what's coming in the rest of it.

The first two give you a thorough understanding of Ajax and the XMLHttpRequest, the third a study of advanced Javascript techniques, with an emphasis on writing object-oriented Javascript that you'll neeed to understand, and the fourth is a survey of open source Ajax tookits that are employed in the rest of the book.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vinay Joseph
Greenhorn

Joined: Jun 05, 2006
Posts: 4
AJAX in portlet...

Is there a way to access AJAX javascripts written in .js files from the portlets? It is difficult to manage & reuse when all the javascripts are written in the JSP file.
Matt Kidd
Ranch Hand

Joined: Jul 17, 2002
Posts: 259
Originally posted by Bear Bibeault:
Yes, the first four chapters of the book are designed to get you ready for what's coming in the rest of it.

The first two give you a thorough understanding of Ajax and the XMLHttpRequest, the third a study of advanced Javascript techniques, with an emphasis on writing object-oriented Javascript that you'll neeed to understand, and the fourth is a survey of open source Ajax tookits that are employed in the rest of the book.


How much javascript knowledge is required before reading this book though?
David C. Crane
author
Ranch Hand

Joined: Oct 13, 2005
Posts: 59
Is there a way to access AJAX javascripts written in .js files from the portlets? It is difficult to manage & reuse when all the javascripts are written in the JSP file.


Hi Vins,

Don't do it, please!! In an Ajax app, there's enough Javascript in there to warrant keeping it in separate .js files, which are served as static resources by the server. If you're writing Javascript inside your JSP's, keep it to a minimum. Think of the JS files as a separate tier in your app, if you like.

Dave
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61066
    
  66

Originally posted by Matt Kidd:


How much javascript knowledge is required before reading this book though?


Basic stuff. If you don't know how to write simple Javascript statements, that's something to tackle first.

But advanced Javascript concepts like object-orientation, functions as first-class objects, function contexts, constructors, closures and the like are handled in chapter 3.
[ April 10, 2007: Message edited by: Bear Bibeault ]
David C. Crane
author
Ranch Hand

Joined: Oct 13, 2005
Posts: 59
Originally posted by Matt Kidd:


How much javascript knowledge is required before reading this book though?


Hi Matt,

To write a moderately complex Ajax app, you'll need to know a fair bit about Javascript. Most web devs are familiar with using small Javascript snippets. Chapter 3 is designed to address the jump from knowing that much to getting to grips with the language for use with Ajax.

The frameworks that we cover in chapter 4 (and use throughout chapters 5+) make it a lot simpler to write and maintain Ajax-level Javascript than in the good old days of wrestling with cross-browser quirks by hand.

So, yes, there is a learning curve, but I think we make it as gentle as possible.

Dave

PS: On a personal note, I should add that learning Javascript has improved the way that I write Java and C#. JS has a strong functional lineage, and it's worth every coder's time to understand how functional languages work - recent trends inboth Java and .NET have shown a renewed interest in functional coding in the enterprise. There are other ways in - Lisp, OCaml, Erlang - but Javascript is a gentle, practical and rewarding way of doing it.
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2849
    
  11

I'm sure the technical stuff is great. Does the book also give examples of how to use Ajax effectively? I don't like to shove new technology onto a page just for the sake of being new. (Well, actually, yes I do, but I have to justify it to management somehow.)
Jord Sonneveld
Author
Ranch Hand

Joined: Apr 09, 2007
Posts: 31
Originally posted by David C. Crane:


Hi Vins,

Don't do it, please!! In an Ajax app, there's enough Javascript in there to warrant keeping it in separate .js files, which are served as static resources by the server. If you're writing Javascript inside your JSP's, keep it to a minimum. Think of the JS files as a separate tier in your app, if you like.

Dave


Another pet peeve of mine is that sometimes, in DOM element event handlers (onClick and friends), I MUST write some JavaScript, which really offends my sense of keeping presentation and logic separate. In our event handling chapter, we'll show you how to register those event handlers w/o having to write these event handling attributes in your HTML. This way you can really separate out your logic and layout, and prevent inadvertent bungling of the JS in your HTML.
Jord Sonneveld
Author
Ranch Hand

Joined: Apr 09, 2007
Posts: 31
Originally posted by Greg Charles:
I'm sure the technical stuff is great. Does the book also give examples of how to use Ajax effectively? I don't like to shove new technology onto a page just for the sake of being new. (Well, actually, yes I do, but I have to justify it to management somehow.)


Hi Greg,

We do have lot of examples + code in the book that shows you how to apply these techniques into situations you'll come across in the real world (e.g. data pre-fetching). So the book isn't just a discussion of what you can do; it also shows you how to do it by way of little examples that showcase the techniques in question.

I hope that answers your question.

j\s
Rashid Darvesh
Ranch Hand

Joined: Feb 13, 2004
Posts: 189
[Edit: reply removed. Rashid, please don't post the same content in multiple topics]
[ April 10, 2007: Message edited by: Bear Bibeault ]
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Originally posted by Jord Sonneveld:

So the book isn't just a discussion of what you can do; it also shows you how to do it by way of little examples that showcase the techniques in question.


Sounds good.

Thanks authors to make reader life easier.


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9351
    
    2

Authors,

Wonderful to note that Ajax in practice is more of a practical book targeted to all level of audiences!
hani Ibrahim
Ranch Hand

Joined: Sep 06, 2006
Posts: 182
Hi Auther,
What about some problems of Ajax and drawbacks do you mention that and how to use ajax with best practices
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61066
    
  66

As the title suggests, the book looks at Ajax from a practical viewpoint. So yes, drawbacks of Ajax techniques are discussed, along with practical suggestions for dealing with them.

One example: dynamically altering the client-side DOM can cause the normal tab order of form elements to get screwed up. We explore ways that you can enusre that the tab order remains intuitive and logical on dynamic pages.
Anupam Sinha
Ranch Hand

Joined: Apr 13, 2003
Posts: 1088
With my limited knowledge and experience on AJAX, I think that AJAX's basically XMLHttpRequest and javascript. XMLHttpRequest is good enough for getting a response and after that it's all javascript. So I guess the book mainly covers javascript and probably some design patterns as well. Or is there more to AJAX minus javascript than XMLHttpRequest?

And Appendix B is Why Go Commercial? Can you give a hint as to whether it talks about some open source tools or some paid ones to make life easier.
Jord Sonneveld
Author
Ranch Hand

Joined: Apr 09, 2007
Posts: 31
Originally posted by Anupam Sinha:
With my limited knowledge and experience on AJAX, I think that AJAX's basically XMLHttpRequest and javascript. XMLHttpRequest is good enough for getting a response and after that it's all javascript. So I guess the book mainly covers javascript and probably some design patterns as well. Or is there more to AJAX minus javascript than XMLHttpRequest?

So, very basically, AJAX = XHR + DHTML + JavaScript + XML. If you take away the JavaScript, then you're left with DHTML + XHR + XML. But don't underestimate the JavaScript part. Using XHR in your apps really affects your client UI. You can do more powerful things, but of course at the cost of added complexity. We hope to show you how to handle that complexity.

And Appendix B is Why Go Commercial? Can you give a hint as to whether it talks about some open source tools or some paid ones to make life easier.

It was decided to make B an on-line only chapter. Yes, it will discuss commercial tools to make life easier; as you may guess, there isn't much discussion of open source tools in the "Why Go Commercial" chapter . That's because the rest of the book purely focuses on open source solutions.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: AJAX in Practice: OK for Ajax newbies?