﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Laith Zraikat: Web Development</title><link>http://laithz.jeeran.com/categories/Web_Development/</link><description>I Innovate, Therefore I Am.</description><pubDate>Mon, 13 Oct 2008 15:42:29 GMT</pubDate><copyright>Copyright 2008 Laith</copyright><generator>jeeran RSSGenerator v1.0</generator><image><url>http://laithz.jeeran.com/photos/profile_t.jpg</url><title>Laith Zraikat: Web_Development</title><link>http://laithz.jeeran.com/categories/Web_Development/</link></image><item><title>CSS Series #1: Simple navigation menu with rollover effects</title><link>http://laithz.jeeran.com/archive/2006/5/54467.html</link><guid isPermaLink="false">54467</guid><description>&lt;p dir="ltr"&gt;I have decided to start writing a series of articles on CSS because of the many questions I get from friends and fellow developers seeking answers to specific questions like this one. &lt;br /&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;Creating rich menus has always been a major issue for most web developers. I remember when I first started doing web design back in 97, my jaw used to drop each time I saw a sliding menu or one with rollover effects. Back then if you wanted a really rich menu, you had to use Java palettes, which was rocket science to most designers.&lt;br /&gt;&lt;br /&gt;Fortunately today, a wide array of rich interface elements are possible using only CSS and a little JavaScript which can be learned in minutes.&lt;br /&gt;&lt;br /&gt;A common question people ask is: How do I create a tabbed menu with rollover effects?&lt;br /&gt;&lt;br /&gt;The approach I like most is one that employs CSS, very little JavaScript, and of course HTML. I will start by explaining the HTML components of our menu and then move on to the CSS part. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The magical HTML List:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Almost every designer uses the ordered list &amp;lt;ol&amp;gt;, or the un-ordered list &amp;lt;ul&amp;gt; at least a few times in every project. Most people think they should use it only when they want to create numbered lists or bullet lists. Well, that was true back in the days when the Yahoo homepage had a gray background and Amazon.com had the jungle theme.&lt;br /&gt;&lt;br /&gt;Today, it is very important to know what kind of markup you need to use and why. You will come across a variety of ways to achieving he same result and it will be up to you to decide which is best for your case. Having said that, I think there is one rule of thumb that should apply to all cases: Always use semantic markup. &lt;/p&gt;&lt;p dir="ltr"&gt;Semantic means "descriptive", hence "descriptive markup". To demonstrate, take the following site menu. The first example does not use any semantic markup: &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 10pt;"&gt;HTML:&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir="ltr" style="color: rgb(30, 144, 255);"&gt;Site Menu&lt;br /&gt;&amp;lt;blockquote&amp;gt;&lt;br /&gt;&amp;lt;a href="/"&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;&amp;lt;a href="/"&amp;gt;Overview&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;&amp;lt;a href="/"&amp;gt;Services&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;&amp;lt;a href="/"&amp;gt;Contact&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;/blockquote&amp;gt;&lt;/p&gt;&lt;p dir="ltr"&gt;Notice how the list effect is achieved by using &amp;lt;blockquote&amp;gt; and &amp;lt;br&amp;gt;, which were not made specifically for formatting a list of items. Anybody can use these two tags to display a whole lot of things, none of which are item lists.&lt;/p&gt;&lt;p dir="ltr"&gt;The second example shows semantic markup that represents the site menu: &lt;br /&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 10pt;"&gt;HTML:&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="color: rgb(30, 144, 255);"&gt;Site Menu&lt;br /&gt;&amp;lt;ul id="menu"&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a href="/"&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a href="/"&amp;gt;Overview&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a href="/"&amp;gt;Services&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a href="/"&amp;gt;Contact&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;/ul&amp;gt;&lt;/p&gt;&lt;p dir="ltr"&gt; If we use the first method, only a human will be able to figure out that this code represents a hierarchal list of items. Another down side is that the list may be rendered differently on different platforms, so your list or menu in this case may not be comprehensible on a mobile phone for example. &lt;br /&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;Another advantage of using the html list is that you can represent a hierarchy of items in the form of nested lists very easily by starting a new list inside any of the main list items. If you wanted to have sub-lists using the first method, you will make a big mess out of your html, and it will just look stupid. &lt;br /&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-weight: bold;"&gt;Arrange it horizontally:&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 10pt;"&gt;CSS:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(199, 21, 133);"&gt;/*Setting the display for the list items to inline will arrange them horizontally*/&lt;/span&gt;&lt;br style="color: rgb(199, 21, 133);" /&gt;&lt;span style="color: rgb(199, 21, 133);"&gt;#menu li{&lt;/span&gt;&lt;br style="color: rgb(199, 21, 133);" /&gt;&lt;span style="color: rgb(199, 21, 133);"&gt;display: inline;&lt;/span&gt;&lt;br style="color: rgb(199, 21, 133);" /&gt;&lt;span style="color: rgb(199, 21, 133);"&gt;} &lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="margin-left: 40px;"&gt;&lt;span style="color: rgb(105, 105, 105);"&gt;&lt;span style="font-weight: bold;"&gt;Note:&lt;/span&gt; You notice that I use #menu as a prefix for all my styles. This is because my main menu ID is "menu". This causes my styles to only affect the html elements inside "expenses". You don't have to use a prefix unless you have more than one menu and you want to have different styles and behavior for each. However, I always like using it as a standard. You can, however, substitute "#menu" with "ul" in your css and it will work just fine. &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir="ltr" style="margin-left: 40px;"&gt;&lt;span style="color: rgb(105, 105, 105);"&gt;&lt;span style="font-weight: bold;"&gt;Note:&lt;/span&gt; I used "/**/" in the first css example above. Anything you write between "/*" and "*/" is considered a comment and will not affect your css. It's just to remind you and let other designers know what this style is for. &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-weight: bold;"&gt;Give it some style:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;We need to apply some styles to our menu to make it look nicer. &lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-size: 10pt;"&gt;CSS:&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir="ltr" style="color: rgb(199, 21, 133);"&gt;/*Sets the style for the main menu*/&lt;br /&gt;#menu {&lt;br /&gt;margin: 0px&lt;br /&gt;margin-top: 15px;&lt;br /&gt;padding: 0px;&lt;br /&gt;width: 500px;&lt;br /&gt;}&lt;/p&gt;&lt;p dir="ltr" style="color: rgb(199, 21, 133);"&gt;#menu li {&lt;br /&gt;display: inline;&lt;br /&gt;margin: 0px;&lt;br /&gt;}&lt;/p&gt;&lt;p dir="ltr" style="color: rgb(199, 21, 133);"&gt;#menu li a {&lt;br /&gt;padding: 6px;&lt;br /&gt;border-bottom: 0px;&lt;br /&gt;background-color: #9c0;&lt;br /&gt;text-decoration: none;&lt;br /&gt;color: #fff;&lt;br /&gt;border: 1px solid #666;&lt;br /&gt;}&lt;/p&gt;&lt;p dir="ltr" style="margin-left: 40px; color: rgb(105, 105, 105);"&gt;&lt;span style="font-weight: bold;"&gt;Note:&lt;/span&gt; Those of you accustomed to setting colors in your web page by manually inserting its hex code may find it strange that I used only 3 digits instead of the usual 6 for my colors. Abbreviation is possible when the two digits for each of the basic colors (red,green,blue) are the same, by representing every color with one digit. For example: #99cc00 can be referred to as #9c0, #ff9900 --&amp;gt; #f90, #ffffff --&amp;gt; #fff…..etc. This form is supported in both IE and FF&lt;span style="font-weight: bold;"&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-weight: bold;"&gt;Roll it over:&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;Imagine you could talk to the browser, and tell it to create a rollover effect. You would say: "when the user puts the mouse pointer over the link, please change its background color to white and text color to grey". Here's how we say it in CSS: &lt;br /&gt;&lt;/p&gt;&lt;p dir="ltr" style="color: rgb(199, 21, 133);"&gt;#menu li a:hover {&lt;br /&gt;background-color: #fff;&lt;br /&gt;color: #666;&lt;br /&gt;} &lt;/p&gt;&lt;p dir="ltr"&gt;Note: "hover" is called a Selector. A selector is the condition which is matched, will trigger the changes specified in the style class to the element which it is related to- in this case the &amp;lt;a&amp;gt; tag in our menu. &lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Tab it:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;You may want to create a tab effect by presetting one of the links to be selected when displayed on a certain page…"Services" for example. You can do that by defining a new css class, for example "selected", and then assigning it to the link you wish to display as selected:&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(199, 21, 133); font-size: 10pt;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;CSS:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style="color: rgb(199, 21, 133);" /&gt;&lt;span style="color: rgb(199, 21, 133);"&gt;#menu li a:hover, #menu selected {&lt;/span&gt;&lt;br style="color: rgb(199, 21, 133);" /&gt;&lt;span style="color: rgb(199, 21, 133);"&gt;background-color: #fff;&lt;/span&gt;&lt;br style="color: rgb(199, 21, 133);" /&gt;&lt;span style="color: rgb(199, 21, 133);"&gt;color: #666;&lt;/span&gt;&lt;br style="color: rgb(199, 21, 133);" /&gt;&lt;span style="color: rgb(199, 21, 133);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;HTML:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(30, 144, 255);"&gt;&amp;lt;ul id="menu"&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(30, 144, 255);" /&gt;&lt;span style="color: rgb(30, 144, 255);"&gt;&amp;lt;li&amp;gt;&amp;lt;a href="/"&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(30, 144, 255);" /&gt;&lt;span style="color: rgb(30, 144, 255);"&gt;&amp;lt;li&amp;gt;&amp;lt;a href="/"&amp;gt;Overview&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(30, 144, 255);" /&gt;&lt;span style="color: rgb(30, 144, 255);"&gt;&amp;lt;li&amp;gt;&amp;lt;a href="/" class="services"&amp;gt;Services&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(30, 144, 255);" /&gt;&lt;span style="color: rgb(30, 144, 255);"&gt;&amp;lt;li&amp;gt;&amp;lt;a href="/"&amp;gt;Contact&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br style="color: rgb(30, 144, 255);" /&gt;&lt;span style="color: rgb(30, 144, 255);"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr"&gt;&lt;span style="font-weight: bold;"&gt;And you have a menu:&lt;/span&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;!--#menu { margin: 0px; margin-top: 15px; padding: 0px; width: 500px;}#menu li { display: inline; margin: 0px;}#menu li a { padding: 6px; background-color: #9c0; text-decoration: none; color: #fff; border: 1px solid #666; border-bottom: 0px; }#menu li a:hover, #menu .selected { background-color: #fff; color: #666;}--&gt;&lt;/style&gt;&lt;ul id="menu"&gt;&lt;li&gt;&lt;a href="/"&gt;Home&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="/overview.html"&gt;Overview&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="/services.html" class="selected"&gt;Services&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="/contact.html"&gt;Contact&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt; &lt;/p&gt; </description><pubDate>Mon, 29 May 2006 23:47:00 GMT</pubDate><comments>http://laithz.jeeran.com/archive/2006/5/54467.html#comments</comments><author>Laith&lt;laithz@jeeran.com&gt;</author><category domain="http://laithz.jeeran.com/categories/CSS/">CSS</category><category domain="http://laithz.jeeran.com/categories/Internet/">Internet</category><category domain="http://laithz.jeeran.com/categories/Web_Development/">Web Development</category></item><item><title>Implementing Image rollover using CSS</title><link>http://laithz.jeeran.com/archive/2006/4/51438.html</link><guid isPermaLink="false">51438</guid><description>Using Css makes your life easier when you want to make changes to your design and helps you think in an Object Oriented manner when designing.A friend of mine asked me to explain how to create a roll-over effect without having to use any JavaScript, so I wrote this for him an thought it's worth sharing. &lt;br /&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;This tip only works in FF. For IE you'll have to do just a little bit of JavaScript. &lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;&lt;span style="font-weight: bold;"&gt;To use CSS only in FireFox:&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;&lt;span style="text-decoration: underline;"&gt;CSS:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: maroon;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: maroon;"&gt;.Icon&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;br /&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;background&lt;/span&gt;: &lt;span style="color: blue;"&gt;url(http://laithz.jeeran.com/blogimages/bul3.gif)&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: maroon;"&gt;div:hover.Icon&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;br /&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;background&lt;/span&gt;: &lt;span style="color: blue;"&gt;url(&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue;"&gt;http://laithz.jeeran.com/blogimages/bul2.gif&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: blue;"&gt;)&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: maroon;"&gt;.Icon, &lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: maroon;"&gt;div:hover.Icon&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{ &lt;br /&gt;&lt;span style="color: red;"&gt; height&lt;/span&gt;: &lt;span style="color: blue;"&gt;102px&lt;/span&gt;;&lt;br /&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;width&lt;/span&gt;: &lt;span style="color: blue;"&gt;71px&lt;/span&gt;;&lt;br /&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;background&lt;/span&gt;: &lt;span style="color: blue;"&gt;no-repeat&lt;/span&gt;;&lt;br /&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;cursor&lt;/span&gt;: &lt;span style="color: blue;"&gt;pointer&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;&lt;span style=""&gt;&lt;span style="text-decoration: underline;"&gt;HTML:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: maroon;"&gt;div&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;class&lt;/span&gt;&lt;span style="color: blue;"&gt;="Icon"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;div&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;&lt;span style=""&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;&lt;span style=""&gt;&lt;span style="font-weight: bold;"&gt;For IE, we have to use JavaScript in addition to CSS:&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;&lt;/span&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed; text-decoration: underline;"&gt;&lt;span style=""&gt;CSS:&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;&lt;/p&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: maroon;"&gt;.Icon&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;br /&gt;&lt;span style="color: red;"&gt;background&lt;/span&gt;: &lt;span style="color: blue;"&gt;url(http://laithz.jeeran.com/blogimages/bul3.gif)&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: maroon;"&gt;.IconOn&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;br /&gt;&lt;span style="color: red;"&gt;background&lt;/span&gt;: &lt;span style="color: blue;"&gt;url(http://laithz.jeeran.com/blogimages/bul2.gif)&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: maroon;"&gt;.&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: maroon;"&gt;IconOn&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: maroon;"&gt;, .Icon&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{ &lt;br /&gt;&lt;span style="color: red;"&gt; height&lt;/span&gt;: &lt;span style="color: blue;"&gt;102px&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: red;"&gt;width&lt;/span&gt;: &lt;span style="color: blue;"&gt;71px&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: red;"&gt;background&lt;/span&gt;: &lt;span style="color: blue;"&gt;no-repeat&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: red;"&gt;cursor&lt;/span&gt;: &lt;span style="color: blue;"&gt;pointer&lt;/span&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;&lt;span style="text-decoration: underline;"&gt;JavaScript:&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;&lt;br style="" /&gt;&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;function&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; SwitchStyleClass(Obj, NewClass)&lt;br /&gt;{&lt;br /&gt;&lt;span style=""&gt;&lt;/span&gt;Obj.className = NewClass;&lt;br /&gt;}&lt;/span&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;&lt;span style=""&gt;&lt;span style="text-decoration: underline;"&gt;HTML:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: maroon;"&gt;div&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style="color: red;"&gt;class&lt;/span&gt;&lt;span style="color: blue;"&gt;="Icon"&lt;/span&gt;&lt;span style="color: red;"&gt;onmouseover&lt;/span&gt;&lt;span style="color: blue;"&gt;="SwitchStyleClass(this, 'IconOn');"&lt;/span&gt;&lt;span style="color: red;"&gt;onmouseout&lt;/span&gt;&lt;span style="color: blue;"&gt;="SwitchStyleClass(this, 'Icon');"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;div&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;&lt;span style=""&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" dir="ltr" style="text-align: left; direction: ltr; unicode-bidi: embed;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: maroon;"&gt;Enjoy!&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/p&gt;</description><pubDate>Fri, 28 Apr 2006 17:12:00 GMT</pubDate><comments>http://laithz.jeeran.com/archive/2006/4/51438.html#comments</comments><author>Laith&lt;laithz@jeeran.com&gt;</author><category domain="http://laithz.jeeran.com/categories/CSS/">CSS</category><category domain="http://laithz.jeeran.com/categories/Internet/">Internet</category><category domain="http://laithz.jeeran.com/categories/Web_Development/">Web Development</category></item><item><title>Back to Nature</title><link>http://laithz.jeeran.com/archive/2006/4/51436.html</link><guid isPermaLink="false">51436</guid><description>The beautiful thing about blogs is that without their CSS, they all look almost the same.&lt;br /&gt;&lt;br /&gt;To know more about why styles are disabled on this website visit the &lt;a href="http://naked.dustindiaz.com/" title="Web Standards Naked Day Host Website"&gt;Annual CSS Naked Day&lt;/a&gt; website for more information.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description><pubDate>Wed, 05 Apr 2006 14:27:00 GMT</pubDate><comments>http://laithz.jeeran.com/archive/2006/4/51436.html#comments</comments><author>Laith&lt;laithz@jeeran.com&gt;</author><category domain="http://laithz.jeeran.com/categories/Web_Development/">Web Development</category></item><item><title>Jeeran Imports Blogger.com</title><link>http://laithz.jeeran.com/archive/2006/3/51429.html</link><guid isPermaLink="false">51429</guid><description>&lt;div style="text-align: justify;"&gt;I am so thrilled to announce that "&lt;a style="font-weight: bold;" href="http://www.jeeran.com/blogs/?lang=e"&gt;Jeeran Blogs&lt;/a&gt;" is officially out of beta phase. &lt;br /&gt;A lot of enhancements have been put in, including a prettier UI. The most significant feature in this update is the &lt;a href="http://www.jeeran.com/blogs/migratehelp.aspx?lang=e"&gt;&lt;span style="font-weight: bold;"&gt;Blogger Importer&lt;/span&gt;&lt;/a&gt;. If you want to move from Blogger.com to Jeeran Blogs, you can now take all you posts and comments along. Nothing is left behind ?, and with no hassle at all. All you have to do is submit a request to our support team and they will do the rest.&lt;img style="border: medium none ;" alt="" src="http://www.airlinetycoons.com/blogimages/import.gif" align="right" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;Among the people who moved to Jeeran during the testing phase and who we want to thank are:&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;Sabri Hakim:&lt;br /&gt;previously (&lt;a style="font-weight: bold;" href="http://sabrihakim.blogspot.com/" target="_blank"&gt;sabrihakim.blogspot.com&lt;/a&gt;), now (&lt;a style="font-weight: bold;" href="http://www.sabrihakim.com/" target="_blank"&gt;http://www.sabrihakim.com/&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Talasim:&lt;br /&gt;&lt;div style="text-align: justify;"&gt;previously (&lt;a style="font-weight: bold;" href="http://zeidkoudsi.blogspot.com/" target="_blank"&gt;zeidkoudsi.blogspot.com&lt;/a&gt;), moved in with (&lt;a style="font-weight: bold;" href="http://www.talasim.com/" target="_blank"&gt;http://www.talasim.com/&lt;/a&gt;)&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Proactivity Group:&lt;br /&gt;previously(&lt;a style="font-weight: bold;" href="http://proactivitygroup.blogspot.com/" target="_blank"&gt;proactivitygroup.blogspot.com&lt;/a&gt;),now (&lt;a style="font-weight: bold;" href="http://proactivitygroup.blogspot.com/" target="_blank"&gt;proactivitygroup.jeeran.com&lt;/a&gt;)&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;a style="font-weight: bold;" href="http://www.jeeran.com/blogs/migratehelp.aspx?lang=e" target="_blank_"&gt;Read more about our Blogger Importer.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Another major enhancement is the ability to further customize the look of your Blog. We have given you full control over your template's CSS code, which means that you can change almost any element in your Blog.&lt;br /&gt;&lt;br /&gt;Thanks goes to the entire Jeeran team on a job well done; Developers, writers, designers, testers and most importantly our customer support for helping our members and keeping then happy ? And to our partners who continue to help and support us in our mission to change the world.&lt;br /&gt;&lt;br /&gt;More amazing things to come from Jeeran, so stay tuned. This is just the beginning.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;</description><pubDate>Thu, 02 Mar 2006 22:10:00 GMT</pubDate><comments>http://laithz.jeeran.com/archive/2006/3/51429.html#comments</comments><author>Laith&lt;laithz@jeeran.com&gt;</author><category domain="http://laithz.jeeran.com/categories/Blogging/">Blogging</category><category domain="http://laithz.jeeran.com/categories/Internet/">Internet</category><category domain="http://laithz.jeeran.com/categories/Jeeran/">Jeeran</category><category domain="http://laithz.jeeran.com/categories/Web_Development/">Web Development</category></item><item><title>ASP.Net 2.0 &amp;quot;How to&amp;quot; Videos</title><link>http://laithz.jeeran.com/archive/2006/2/51428.html</link><guid isPermaLink="false">51428</guid><description>Recently released video lessons on the common questions about the new features in ASP.Net 2.0. They will provide clear, easy, and straight to the point examples on how to perform some advanced functions. They are great for all levels, newbie to expert.&lt;br /&gt;&lt;br /&gt;The topics covered:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Caching (2 parts)&lt;/li&gt;&lt;li&gt;Create a full-featured customer login protal&lt;/li&gt;&lt;li&gt;Data: create data driven web sites&lt;/li&gt;&lt;li&gt;Form Building&lt;/li&gt;&lt;li&gt;Localization&lt;/li&gt;&lt;li&gt;Master Pages and Site Navigation&lt;/li&gt;&lt;li&gt;Membership and Roles&lt;/li&gt;&lt;li&gt;Profiles and Themes&lt;/li&gt;&lt;li&gt;Web Parts and Personalization&lt;/li&gt;&lt;li&gt;Tips and Tricks: covers a wide range of techniques for enhancing ASP.Net web pages.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;For a more detailed description and download links, read:&lt;br /&gt;&lt;a href="http://blogs.msdn.com/bgold/archive/2006/02/20/535869.aspx" target="_blank"&gt;ASP.NET 2.0 How Do I Video Series is here -- a must see&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;</description><pubDate>Sat, 25 Feb 2006 15:00:00 GMT</pubDate><comments>http://laithz.jeeran.com/archive/2006/2/51428.html#comments</comments><author>Laith&lt;laithz@jeeran.com&gt;</author><category domain="http://laithz.jeeran.com/categories/.Net_Development/">.Net Development</category><category domain="http://laithz.jeeran.com/categories/Web_Development/">Web Development</category></item><item><title>Amazon Associate Books Rotator for your Blog using AJAJ</title><link>http://laithz.jeeran.com/archive/2006/2/51427.html</link><guid isPermaLink="false">51427</guid><description>Last week I wanted to list some of the books that I've read and/or recommend. So I thought I'd also make some money while I'm at it. I created an Amazon reseller account and stared creating affiliate links. &lt;p&gt;Since Amazon does not have an automated way to generate code that will rotate several books, I decided to create one using JavaScript Asynchronous Callback and JSON.&lt;/p&gt;&lt;p&gt;This small solution consists of 2 files:&lt;br /&gt;1. books.txt: contains the list if ISBN's for the books&lt;br /&gt;2. books_json.js: JavaScript file that contains the code which will retrieve the list of ISBN's through xmlHTTPRequest, and then pick a random book and displays it.&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;This is how the code looks:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold; font-size: 10pt;"&gt;Book.txt:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; color: rgb(0, 51, 255);"&gt;{"Book": &lt;br /&gt;[&lt;br /&gt;{"Code": "0393058581"}, &lt;br /&gt;{"Code": "1590595009"}, &lt;br /&gt;{"Code": "1590593898"},&lt;br /&gt;{"Code": "0385483821"},&lt;br /&gt;{"Code": "0684855542"},&lt;br /&gt;{"Code": "0375727205"}&lt;br /&gt;]&lt;br /&gt;}&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold; font-size: 10pt;"&gt;Books_json.js:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; color: rgb(51, 153, 0);"&gt;// Settings you can modify&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 255);"&gt;var affiliateID = "numbersixteen-20";&lt;/span&gt;&lt;span style="color: rgb(51, 153, 0);"&gt;// Your amazon associate ID &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 255);"&gt;var Width = "120px";&lt;/span&gt;&lt;span style="color: rgb(51, 153, 0);"&gt; // Box Width &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 255);"&gt;var Height = "240px";&lt;/span&gt;&lt;span style="color: rgb(51, 153, 0);"&gt;// Box Height &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 255);"&gt;var fcl = "000000";&lt;/span&gt;&lt;span style="color: rgb(51, 153, 0);"&gt;// Text Color&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 255);"&gt;var lcl = "0000ff";&lt;/span&gt;&lt;span style="color: rgb(51, 153, 0);"&gt; // Link Color&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 255);"&gt;var bcl = "000000";&lt;/span&gt;&lt;span style="color: rgb(51, 153, 0);"&gt;// Frame (border) color&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 255);"&gt;var bgl = "ffffff";&lt;/span&gt;&lt;span style="color: rgb(51, 153, 0);"&gt; // Background color&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; color: rgb(51, 153, 0);"&gt;//Ony modify if you know what youre doing &lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(0, 51, 255);"&gt;&lt;br /&gt;var dataURL = "/books.txt";&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; color: rgb(0, 51, 255);"&gt;//Create the XMLHTTPRequest object&lt;span style="color: rgb(51, 153, 0);"&gt;&lt;br /&gt;&lt;/span&gt;var requester;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;requester = new XMLHttpRequest();&lt;br /&gt;}&lt;br /&gt;catch (error)&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;requester = new ActiveXObject("Microsoft.XMLHTTP");&lt;br /&gt;}&lt;br /&gt;catch (error)&lt;br /&gt;{ &lt;br /&gt;requester = null;&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; color: rgb(51, 153, 0);"&gt;// Open the XMLHTTPRequest, set the method to GET, give it the URL to fetch and set (Asynch = true) so the rest of the page can still download while the data is downloaded&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; color: rgb(0, 51, 255);"&gt;requester.open("GET", dataURL, true);&lt;br /&gt;requester.send(null);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; color: rgb(51, 153, 0);"&gt;// When the request is done, we call stateHandler which will perform the the needed actions IF we actualyl got a response.&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(0, 51, 255);"&gt;&lt;br /&gt;requester.onreadystatechange = stateHandler;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; color: rgb(0, 51, 255);"&gt;function stateHandler()&lt;br /&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; color: rgb(0, 51, 255);"&gt;&lt;span style="color: rgb(51, 153, 0);"&gt;// The XMLHttpRequest has finished requesting the data &lt;/span&gt;&lt;br /&gt;if (requester.readyState == 4) {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; color: rgb(0, 51, 255);"&gt;&lt;span style="color: rgb(51, 153, 0);"&gt;// The data was receieved successfully&lt;/span&gt;&lt;br /&gt;if (requester.status == 200) &lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(51, 153, 0);"&gt;// There no need ot do anything if no text was received.&lt;/span&gt;&lt;br /&gt;if (requester.responseText != "")&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(51, 153, 0);"&gt;// Get the JSON list of book ISBN's and compile it&lt;/span&gt;&lt;br /&gt;var Books = eval( '(' + requester.responseText + ')' );&lt;br /&gt;&lt;span style="color: rgb(51, 153, 0);"&gt;// Generate a random index from the Books Object&lt;/span&gt;&lt;br /&gt;var whichBook=Math.floor(Math.random()*(Books.Book.length));&lt;br /&gt;&lt;span style="color: rgb(51, 153, 0);"&gt;// Get the Book ISBN&lt;/span&gt;&lt;br /&gt;var Book = Books.Book[whichBook].Code;&lt;br /&gt;requester = null;&lt;br /&gt;&lt;span style="color: rgb(51, 153, 0);"&gt;// Build the HTML code to place in the page&lt;/span&gt;&lt;br /&gt;var amazonCode = "&amp;lt;iframe src='http://rcm.amazon.com/e/cm?t="+ affiliateID +"&amp;amp;o=1&amp;amp;p=8&amp;amp;l=as1&amp;amp;asins="+Book+"&amp;amp;fc1=" + fcl + "&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;lc1=" + lcl + "&amp;amp;bc1=" + bcl + "&amp;amp;bg1=" + bgl + "&amp;amp;f=ifr' style='width:"+Width+";height:"+Height+";' scrolling='no' marginwidth='0' marginheight='0' frameborder='0'&amp;gt;&amp;lt;/iframe&amp;gt;";&lt;br /&gt;&lt;span style="color: rgb(51, 153, 0);"&gt;// Dump the HTML code on the page&lt;/span&gt;&lt;br /&gt;document.getElementById('bookList').innerHTML = amazonCode;&lt;br /&gt;} &lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;requester = null;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;return true;&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Installation on your blog:&lt;/span&gt;&lt;br /&gt;1. Upload the JavaScript and Data files into the root folder of your web site&lt;br /&gt;2. Add the following in your HTML where you want the books to appear:&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; color: rgb(0, 51, 255);"&gt;&amp;lt;div id="bookList" name="bookList"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="/books_json.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Download the source code and example: &lt;br /&gt;&lt;/span&gt;&lt;a href="http://laithz.jeeran.com/scripts/books_json.zip"&gt;books_json.zip&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;In case you want a version that uses XML, here it is:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://laithz.jeeran.com/scripts/books_xml.zip"&gt;books_xml.zip&lt;/a&gt;&lt;/p&gt;</description><pubDate>Sat, 18 Feb 2006 21:24:00 GMT</pubDate><comments>http://laithz.jeeran.com/archive/2006/2/51427.html#comments</comments><author>Laith&lt;laithz@jeeran.com&gt;</author><category domain="http://laithz.jeeran.com/categories/Blogging/">Blogging</category><category domain="http://laithz.jeeran.com/categories/Internet/">Internet</category><category domain="http://laithz.jeeran.com/categories/Web_Development/">Web Development</category></item><item><title>AJAJ (Asynchronous JavaScript and JSON)</title><link>http://laithz.jeeran.com/archive/2006/2/51426.html</link><guid isPermaLink="false">51426</guid><description>JSON (JavaScript Object Notation) is gaining wide appeal as an alternative to XML for transporting data objects between applications. In fact a JSON is closer than XML to transporting true data objects because it is more object oriented and can be mapped more easily to object oriented systems. Being a subset of JavaScript, JSON can be understood by any C-based programming language, and is almost language independent.&lt;p&gt;With XML you had to serialize the object on the server, send to the client, and then de-serialize on the client to get the object –that’s if you were using SOAP. Without using SOAP, you will have to write more code to parse the incoming XML. With JSON, all you have to do is send the text from the server, compile it on the client and you end up with an object.&lt;/p&gt;&lt;p&gt;Example: &lt;/p&gt;&lt;p&gt;Suppose we wanted to send a message from the server to the browser using asynchronous callback, we have the option of sending it as XML or JSON (and of course we can always use plain text)&lt;/p&gt;&lt;p&gt;XML:&lt;br /&gt;&lt;span style="font-size: 10pt; color: rgb(0, 102, 255);"&gt;&amp;lt;Messages&amp;gt;&amp;lt;Msg&amp;gt;&amp;lt;Type&amp;gt;1&amp;lt;/Type&amp;gt;&amp;lt;Text&amp;gt;Hello JSON!&amp;lt;/Text&amp;gt;&amp;lt;/Msg&amp;gt;&amp;lt;/Messages&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;JSON:&lt;br /&gt;&lt;span style="font-size: 10pt; color: rgb(21, 116, 212);"&gt;{"Msg": [{"Type": "1", "Text": "Hello JSON!"}]}&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To parse the Data and display the message, you'll have to use a different approach for each:&lt;/p&gt;&lt;p&gt;XML: We have to parse the XML as text, and even then it remains text as we go through it.&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; color: rgb(0, 102, 255);"&gt;Asynchronous callback code.....&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;var ResponseXML = myHTTPRequest.responseXML();&lt;br /&gt;var Messages = ResponseXML.getElementsByTagName("MSG");&lt;br /&gt;var MessageText;&lt;br /&gt;var MsgType; &lt;br /&gt;for(var i=0; i&amp;lt; Messages.length; i++) {&lt;br /&gt;MsgType = Messages [i].getElementsByTagName("Type")[0].childNodes[0].nodeValue;&lt;br /&gt;MessageText = Messages [i].getElementsByTagName("Text")[0].childNodes[0].nodeValue;&lt;br /&gt;document.write(MsgType +','+ MessageText);&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;JSON: Simply run the text through the compiler. After that, you're dealing with an object not text.&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; color: rgb(0, 102, 255);"&gt;Asynchronous callback code.....&lt;br /&gt;.&lt;br /&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 10pt; color: rgb(0, 102, 255);"&gt;var ResponseText = &lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(0, 102, 255);"&gt;myHTTPRequest&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(0, 102, 255);"&gt;.responseText();&lt;br /&gt;var Messages = eval( '(' + ResponseText + ')' );&lt;br /&gt;var MessageText;&lt;br /&gt;var MsgType; &lt;br /&gt;for(var i=0; i&amp;lt; Messages.MSG.length; i++) {&lt;br /&gt;MessageText = Messages.MSG[i].Text;&lt;br /&gt;MsgType = Messages.MSG[i].Type;&lt;br /&gt;document.write(MsgType +','+ MessageText); &lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Notice that the JSON form is shorter in terms of amount of text sent to the browser and simpler in terms of the code needed to extract the data. Using JSON in this manner also happens to be much faster because instead of parsing text –which we know is a very intensive process- in the case of XML, we are simply compiling it using the &lt;span style="color: rgb(21, 116, 212);"&gt;eval &lt;/span&gt;function which is extremely fast.&lt;/p&gt;&lt;p&gt;However, there are security issues associated with using JSON, namely, the risk of cross-site-scripting. If an attacker sends malicious code as JSON, this code will be activated once it is compiled on the client and can potentially be used to hijack a user's session for example.&lt;/p&gt;&lt;p&gt;What I like about JSON is its simplicity. You can transport an entire data table or even a dataset as text, and convert it into a true data object in one step. It is very promising and threatens to overthrow the X in AJAX.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description><pubDate>Fri, 10 Feb 2006 19:00:00 GMT</pubDate><comments>http://laithz.jeeran.com/archive/2006/2/51426.html#comments</comments><author>Laith&lt;laithz@jeeran.com&gt;</author><category domain="http://laithz.jeeran.com/categories/.Net_Development/">.Net Development</category><category domain="http://laithz.jeeran.com/categories/Web_Development/">Web Development</category></item><item><title>AHAH! the proof!</title><link>http://laithz.jeeran.com/archive/2006/1/51425.html</link><guid isPermaLink="false">51425</guid><description>A new acronym is picking up. I can't believe this is happening again, but its good this time, because this new acronym goes to prove that the first one was not solid. &lt;br /&gt;&lt;br /&gt;I guess since there are AJAX specialists, then we'll expect to see AHAH specialists. But I doubt any of them will have the guts to say it in a conversation ... "I'm an AHAH! specialist" ... the other guy will go "What? what did I do?"&lt;br /&gt;&lt;br /&gt;</description><pubDate>Wed, 25 Jan 2006 21:19:00 GMT</pubDate><comments>http://laithz.jeeran.com/archive/2006/1/51425.html#comments</comments><author>Laith&lt;laithz@jeeran.com&gt;</author><category domain="http://laithz.jeeran.com/categories/Internet/">Internet</category><category domain="http://laithz.jeeran.com/categories/Web_Development/">Web Development</category></item><item><title>Are you a great Graphic, Web, and UI designer who wants to help change the world? We want you!</title><link>http://laithz.jeeran.com/archive/2006/1/51421.html</link><guid isPermaLink="false">51421</guid><description>&lt;img alt="" src="http://www.jeeran.com/im/logos/jEERAN_logo_green_5.jpg" align="right" border="0" /&gt;We are seeking to hire a web and graphic designer to take charge of Jeeran's creative department. The candidate is expected to possess the following qualities: &lt;br /&gt;Leadership, self-learning, creativity, ambition, design vision.&lt;br /&gt;&lt;br /&gt;For more details, view: &lt;a style="font-weight: bold;" href="http://www.jeeran.com/careers/designer.aspx?lang=e"&gt;Jeeran Careers section&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;</description><pubDate>Mon, 16 Jan 2006 16:05:00 GMT</pubDate><comments>http://laithz.jeeran.com/archive/2006/1/51421.html#comments</comments><author>Laith&lt;laithz@jeeran.com&gt;</author><category domain="http://laithz.jeeran.com/categories/Jeeran/">Jeeran</category><category domain="http://laithz.jeeran.com/categories/Web_Development/">Web Development</category></item><item><title>Designers vs. Developers? I prefer Teams!</title><link>http://laithz.jeeran.com/archive/2006/1/51419.html</link><guid isPermaLink="false">51419</guid><description>&lt;p&gt;&lt;a style="font-weight: bold;" href="http://jadmadi.net/why-developers-are-better"&gt;Jad Madi&lt;/a&gt; raised a topic that I'm sure all designers and developers think about regularly during their career: Who is better, developers or designers?&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;In my years of experience, I put on many hats: graphic/web design, development, architecture and analysis, management, even painted some walls while we were building our new offices. In each I felt that my work was not just very important, but essential to the success of the company. And that's the truth. &lt;span dir="rtl" lang="AR-JO"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span dir="rtl" lang="AR-JO"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;In a team, every member is an essential component that plays a unique role in pushing the ship toward its destination. &lt;span dir="rtl" lang="AR-JO"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Having done both design and development, and now that I have to supervise our development team, I don't get to do as much hands-on development as I would like to, so I get to look at both fields from an unbiased point of view. I see them both as essential and in-separable, for two simple reasons:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ol start="1" type="1"&gt;&lt;li&gt;A great application has to be developed by someone who has the great programming skill and can produce an error/bug free experience for the user. Someone who can "design" his application with performance, security, scalability, in mind and compose the code in a way which is comprehendible to other developers on the team.&lt;br /&gt;&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/li&gt;&lt;li&gt;This great application will be worth exactly "zero" if nobody can figure out how to use it, so it needs a very good designer who can "develop" an intuitive user experience. The user experience is the only single factor which can determine the success or failure of an application. If people can't use it, they won't buy it, and the company can’t pay the bills. Simple.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Now, can you imagine one without the other?&lt;/p&gt;&lt;p&gt;&lt;/p&gt; When it comes to producing software, both designers and developers have to be "designers and developers". Designing and producing high quality, bug free code is an art, and developing the user experience involves much more than just designing the interface. &lt;br /&gt;</description><pubDate>Mon, 09 Jan 2006 22:01:00 GMT</pubDate><comments>http://laithz.jeeran.com/archive/2006/1/51419.html#comments</comments><author>Laith&lt;laithz@jeeran.com&gt;</author><category domain="http://laithz.jeeran.com/categories/Thoughts/">Thoughts</category><category domain="http://laithz.jeeran.com/categories/Web_Development/">Web Development</category></item></channel></rss>