JavaScript Fundamentals: Development for Absolute Beginners

By: Bob Tabor

Download the entire series source code here.

JavaScript Fundamentals

This course is divided in 21 parts:

  1. Series Introduction
  2. Writing your First JavaScript Application
  3. Dissecting the First JavaScript Application You Wrote
  4. Writing JavaScript in Visual Web Developer Express Edition
  5. JavaScript Variables, Types, Operators, and Expressions
  6. Conditional Logic in JavaScript
  7. JavaScript Functions
  8. JavaScript Arrays
  9. Looping Statements in JavaScript
  10. Understanding Function versus Global Scope
  11. Working with External JavaScript Files
  12. Organizing and Simplifying JavaScript with Object Literals
  13. Understanding the Document Object Model
  14. Getting Started with jQuery
  15. jQuery Selectors
  16. jQuery Events
  17. Installing and Utilizing jQuery Plugins
  18. Unobtrusive JavaScript
  19. Using jQuery to Retrieve JSON via AJAX
  20. Fundamentals of JavaScript Closures
  21. Series Wrap-Up

URL: http://channel9.msdn.com/Series/Javascript-Fundamentals-Development-for-Absolute-Beginners

Source: Channel 9

JSON Object with integer values as key attributes

Using JSON object selection to paint the output based on descending key values.

JSON Object:

var popularObj= {
“89”:”animation”,
“71”:”apple”,
“64”:”barbara beery”,
“48”:”video”,
“39”:”cheese sticks”,
“29”:”games”,
“28”:”bbq pork sticks”,
“27”:”asian chicken tenders”,
“25”:”bake”,
“24”:”banana”
};

Problem:
The requirement was to paint only the values in descending order as they are the popular searches within the website. Whether we use for in loop or jquery each construct which does the same thing if the variable is an object, our results were varying across browsers namely Google chrome. The reason being in chrome, the key values were seen as array index instead of object key properties. The key values here were treated as indexes (integer indexes) and were painted in reverse order.

In Firefox and IE, we will get

“animation apple barbara beery video cheese sticks games bbq pork sticks asian chicken tenders bake banana”

and in chrome

“banana bake asian chicken tenders bbq pork sticks games cheese sticks video barbara beery apple animation”

Solution:
Convert the object into array, reverse it for chrome browser and then the finally load the dom object.

Note: In case the key was a text then the order of rendering is same across the browsers.

Web 2.0 Design Guide

The list below is a summary of many of the common features being used on “Web 2.0” sites.

Clearly, a site doesn’t need to exhibit all these features to work well, and displaying these features doesn’t mean your site will look Web 2.0.

  1. Simplicity
  2. Central Layout
  3. Fewer Columns
  4. Separate Top Sections
  5. Solid Areas of Screen Real-estate
  6. Simple Navigation
  7. Bold Logos
  8. Bigger Text
  9. Bold Text Introductions
  10. Strong Colors
  11. Rich Surfaces
  12. Gradients
  13. Reflections
  14. Cute Icons
  15. Star Flashes

Source: http://2-0.net

jQuery Cheat Sheet

Remembering the hundreds of jQuery methods and handlers can melt your brain. Use this cheat sheet as a reference.

jQuery Cheat Sheet
jQuery Cheat Sheet

Source: Colorcharge.com

5 Easy Steps to Create a Fixed Header

This jQuery plugin just clones current header and place on top of the table. Follow below 5 steps to create a fixed header row of a normal HTML table or ASP.Net GridView/Datagrid.

Step 1: Include the jQuery library JavaScript file on header section of web page.

Download file (jquery-1.2.6.js)

Step 2: Include the jQuery Fixed Header JavaScript file on header section of web page.

Download file (jquery.fixedheader.js)

Step 3: Add this CSS code in stylesheet or header section of web page.

<style type="text/css">
.dataTable { font-family:Verdana, Arial, Helvetica, sans-serif; border-collapse: collapse; border:1px solid #999999; width: 750px; font-size:12px;}
.dataTable td, .dataTable th {border: 1px solid #999999; padding: 3px 5px; margin:0px;}
.dataTable thead th { background-color:#cccccc; color:#444444; font-weight:bold; text-align:left;}
.dataTable thead a {text-decoration:none; color:#444444; }
.dataTable thead a:hover { text-decoration: underline;}

/* Firefox has missing border bug! https://bugzilla.mozilla.org/show_bug.cgi?id=410621 */
/* Firefox 2 */
html</**/body .dataTable, x:-moz-any-link {margin:1px;}
/* Firefox 3 */
html</**/body .dataTable, x:-moz-any-link, x:default {margin:1px}
</style>

Step 4: Add this JavaScript code in header section of web page.

<script type="text/javascript">
$(document).ready(function(){
$("#data").fixedHeader({
width: 500,height: 300
});
})
</script>

Step 5: Create an HTML table on the page, including THEAD and TBODY sections. This plug-in uses the THEAD to create the fixed rows, and TBODY is our data.

<table id="data" class="dataTable">

<thead>
<tr>
<th> ….. <\th>
<th> ….. <\th>
</tr>
</thead>

<tbody>
<tr>
<td> ….. <\td>
<td> ….. <\td>
</tr>
</tbody>

</table>

Note: For ASP.Net GridView/Datagrid you have to keep the header part in THEAD and put your Gridview/Datagrid in the TBODY section of table but without Grid header.

Our table or GridView with fixed header is now ready to view.

jQuery Plugin for Fixed Header
jQuery Plugin for Fixed Header

Features
1. Allow horizontal scroll
2. Auto hide box when scroll in IE6
3. Allow to adjust header cell width with your own implementation

Requires
jQuery 1.2.6

Compatibility
IE6/7, Firefox 3.0/3.1, Opera 9.5, Chrome 0.2, Safari 3.1.2

Amazing websites – Get more from your surfing

Software and tools

Zoho – http://www.zoho.com

Editgrid – http://www.editgrid.com

ThinkFree Office – http://www.thinkfree.com

Clarizen – http://www.clarizen.com

SlideShare – http://www.slideshare.net

Gliffy – http://www.gliffy.com

SliderRocket – http://www.sliderocket.com

Scribd – http://www.scribd.com

Storage and files

Workspace – http://workspace.officelive.com

Box.net – http://www.box.net

Pando – http://www.pando.com

MozyHome – http://www.mozy.com/home

Zoto – http://www.zoto.com

EyeOS – http://www.eyeos.org

Blist – http://www.blist.com

Dropbox – http://www.getdropbox.com

Carbonite – http://www.carbonite.com

Graphics

Dafont – http://www.dafont.com

Photoshop Express – http://www.photoshop.com/express

Luxa – http://www.luxa.org

Bluestring – http://www.bluestring.com

Imagekind – http://www.imagekind.com

Simplebucket – http://www.simplebucket.com

1001freefonts – http://www.1001freefonts.com

InterfaceLIFT – http://www.interfacelift.com

Picnik – http://www.picnik.com

Research and e-learning

eHow – http://www.ehow.com

Martindale – http://www.martindalecenter.com

Mashery – http://www.mashery.com

Mechanical Turk – http://www.mturk.com

Mumboe – http://www.mumboe.com

PageOnce – http://www.pageonce.com

Mobile workers

Zimbra – http://www.zimbra.com

TokBox – http://www.tokbox.com

Skyscanner – http://www.skyscanner.net

Xe – http://www.xe.com

Twiddla – http://www.twiddla.com

Joost – http://www.joost.com

Vello – http://www.myvello.com

Orgoo – http://www.orgoo.com

Evernote – http://www.evernote.com

Miscellaneous

Daniweb – http://www.daniweb.com

OVGuide – http://www.ovguide.com

Keepm – http://www.keepm.com

Stumpedia – http://www.stumpedia.com

TripIt – http://www.tripit.com

TunesBag – http://www.tunesbag.com

Toluu – http://www.toluu.com

SoSauce – http://www.sosauce.com