jQuery 1.3 with PHP

In the first 2 chapters : Introduction and overview and Quick tricks talks about :
Big projects that use php & jqury :
- wordpress
- drupal
- kfm
- roundcube
Explain very clear that in order to save some time ,instead of realoading the page the dinamically populate select boxes based on user interaction,use quick deletes (remove it from the view),contextual help (tool tips) , inline editing.
Tips I didn't knew :
- $select = '<select name="city"><option>'.join('</option><option>',$cities).'</option></select>'; ( In book the code was wrong so I have submitted to Errata)
- if in Apache configuration I have MultiViews set and allow users to upload images then it exposes some security holes for hackers
Chapter 3 - Tabs and Accordions
It looks at the jquery ui tabs and accordition plugins and there is nice example with chapters from Great Expectations turn into accordions.
Chapter 4 - Forms & Form Validation
It uses the validation plugin , which I haven't use before but I will from now one and a suggestion
Chapter 5 - File Management
Shows a basic manager to create,rename,move and delete file and directories.
What's nice is that uses jQuery Uploadify plug in for file uploads.
Chapter 6 - Calendars
Builds a nice small CRUD events app using jquery week calendar
Chapter 7 - Image manipulation
Show a list of all the images in a directory using Treeview widget . I coudn't manage to install imagemagic on windows but on I could spot some document.getElementById() code in there. It is a jQuery book use $("#)...
For cropping image it is used the JCrop plugin by Kelly Hallman,which I used before and it works very nice.
Chapter 8 - Drag & Drop
First it's a example of sorting a simple list with Sortable Jquery UI plugin.
Then an a multi dimensional list , something like a menu that could have one level submenus.
At the end it's presented a connecting list (drag and drop of email contacts to a to input) example which I think it's the most usefull.
Chapter 9 - Data tables
Uses Datatables plugin (http://www.datatables.net/) .
I was very very impress with this plug in because I haven't used before.
I like a lot Ext Js DataGrid plugin with I think it's supperior to Datatables.
Here are example with data taken with ajax from database,sorting,filtering and pagination.Really usefull.
The plugin is also well documented on it's site.
Chapter 10 - Optimize
Basicly :
- use other plugins to optimize you time
- use JSON instead of XML
- use Ajax instead of page reloads
- script inclusions at the bottom of html
- agreggate and cache scripts
- cache files using a time change for a file in the directory listing
Down sides :
- No Js code incapsulation like :
var MyClass = MyClass || {};
MyClass.param1 = 1;
MyClass.param2 = "I am a string";
MyClass.init = function()
{
.. capture all events
};
MyClass.method1 = function(){}
$(document).ready(MyClass.init);
- using var coutry = $("#country").attr('value') instead of $("#country").val();
- Mentioned about Google CDN but didn't show how to load jquery and jquery ui easier via google.load methods
Something like:
<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript" charset="utf-8">
google.load("jquery", "1.3.2");
google.load("jqueryui", "1.7.2");
</script>
- didn't assign directly function directly to callbacks
In the book :
'event_name' : function(....)
{
fct_callback(....);
}
It can be used directly :
'event_name' : fct_callback(....);
Overall a good book.
Mark 8/10
