Ajax vs Flash Podcast
Tuesday, August 26th, 2008Hi,
I just released a podcast where discuss the differences between Ajax and Flash.
You can read more about it in the killersites.com Magazine.
Hi,
I just released a podcast where discuss the differences between Ajax and Flash.
You can read more about it in the killersites.com Magazine.
Hi,
I just wanted to announce that I am now giving away a series of video lectures on Ajax – about 3 hrs worth.
The Videos:
These videos are not designed to be a tutorial, but rather, they are a lecture. None the less, these videos can help give you at least a basic understanding of what Ajax is all about.
Anyway, they are free, so what do you have to loose!
If you guys want a proper killersites style (simple, practical and to the point) video tutorial, please let me know.
Thanks,
Stefan Mischook
www.killersites.com
www.killerphp.com
A while back a wrote a JavaScript script that automatically styled an HTML table. In a nutshell, the script automatically changes the background color of every 2nd row in an HTML table.
Anyway, someone recently sent me an updated version of the script. You will probably want to read the original article before looking at these changes.
From the email:
I did some simplification on the code for zebrastripes. I don’t bother with the last array bit because TR elements have the bgColor attribute.
trs[i].bgColor = ( i & 1 ) ? stripe_colour_even : stripe_colour_odd;
Greetings,
tarjei
The complete function:
function stripe_table(id_name) {
var my_table = document.getElementById(id_name);
/* For debugging */
if ( !my_table ) {
alert(”The ID ” + id_name + ” is not found.”);
return;
}/* Table may have more than one tbody element */
var tbodies = my_table.getElementsByTagName(”tbody”);for (var cnt = 0; cnt < tbodies.length; cnt++) {
var trs = tbodies[ cnt ].getElementsByTagName("tr");/* Walk table row for row */
for (var i = 0; i < trs.length; i++) {
if (! hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
trs[i].bgColor = ( i & 1 ) ? stripe_colour_even : stripe_colour_odd;
}
}
}
}
}
CIAO.
Stefan Mischook
Hi,
I decided to create another blog post to make it easier to find the updated version of the important matching columns script – it was buried in the originals article’s comments.
Notes:
-
Updated script by: Jonathan del Mar
I have modified the script to work with multiple class groups also with elements with multiple class names
/*
Derived from a script by Alejandro Gervasio.
Modified to work in FireFox by Stefan Mischook for Killersites.com
Modified to work with multiple class groups also with elements with multiple class names
by Jonathan del Mar (dec-14-2006)
How it works: just apply the CSS class of ‘column’ to your pages’ main columns.
to work with different classes
add
var columns = new Array(’class_name1′, ‘class_name1′…);
by Jonathan del Mar
by default the script will call
matchColumns();
and the default class_name is ‘column’
(see the bottom of this script)
by Jonathan del Mar
*/
matchColumns=function(my_class){
var divs,contDivs,maxHeight,divHeight,d;
// get all elements in the document
divs=document.getElementsByTagName(’div’);
contDivs=[];
// initialize maximum height value
maxHeight=0;
if (!my_class) {
my_class = ‘column’;
}
my_regex = new RegExp(’(.* |^)’ + my_class + ‘( .*|$)’);
// iterate over all elements in the document
for(var i=0;i elements with class attribute ‘container’
//if(/\bcolumn\b/.test(divs[i].className)){
// modified by Jonathan del Mar to match ‘column’ in multiple classes
if(my_regex.test(divs[i].className)){
d=divs[i];
contDivs[contDivs.length]=d;
// determine height for element
if(d.offsetHeight){
divHeight=d.offsetHeight;
}
else if(d.style.pixelHeight){
divHeight=d.style.pixelHeight;
}
// calculate maximum height
maxHeight=Math.max(maxHeight,divHeight);
}
}
// assign maximum height value to all of container elements
for(var i=0;i
var columns = new Array(’class_name1′, ‘class_name2′, …);
to your html header.
A very interesting book for experienced programmers.
I’ve reviewed several AJAX books and each has their own slant on the subject. Build Your Own AJAX Web Applications is the first that actually got me to think of AJAX based applications as a replacement for the traditional desktop applications.
… You’d figure I would have clued into this reality before, but for some reason, it only clicked while reading chapter 2!
WHO IS THIS BOOK FOR
Clearly you need to have a web programming background to understand this book. If you’re shaky with programming and object oriented programming is a great mystery to you, then you might find aspects of this book challenging.
On the flip side, if you want a refined and advanced approach to injecting AJAX into your web work, and you are comfortable with Javascript and a server-side language like PHP, then this is a very good book.
TOPICS COVERED
.. yes, I got this list from amazon, but why reinvent the wheel!
MY CONCLUSION
I like the fact that the book does a good job of teaching AJAX while not getting bogged down in useless code and text – the book is concise, to the point and thin.
Get the book.
Stefan Mischook
PayPal Customer Support: 1-888-221-1161
Killersites.com has been a PayPal Verified Merchant since 2001. We also accept payment via check or money order.
Killersites.com Inc. 4156 Dorchester #2 Westmount, Quebec Canada H3Z 1V1
The more you learn, the more you earn!