Client-Side

...now browsing by category

This is where topics regarding the visual side of development and design. XHTML, Javascript, AJAX, CSS are all covered here.

 

I’m not the only CSS sprite skeptic

Tuesday, March 30th, 2010

Resources have been a key focus in the growth of the world wide web.  The more users engaging on a specific web service means that the service will use more resources.  With that theory in mind, one of the many techniques to reduce HTTP requests to speed up the load of a page is the CSS sprite technique.  To summarize the technique, rather than have a plethora of individual background images, you would combine all of the images into a single image and use CSS to access those portions of the image that are needed.

But on to the meat of this post, I’m plugging a recent article at Smashing Magazine that looks at the technique and discusses potential hardships the technique may cause for some designers.

5-for-1 Deal from SitePoint - profits going to victims of Australian bushfires

Thursday, February 12th, 2009


SitePoint Special Sale

Just thought I’d pass this awesome offer along to those that read the blog.

SitePoint is offering a deal to get 5 of their books in PDF format for only $29.99.

The beauty of it is that the proceeds are going to be donated to the victims of the Australian bushfires.

I’ve read a few of the books and some are hit or miss.  I definitely recommend:

Check it out, its for a good cause!

Fixing the yellow input box

Tuesday, February 10th, 2009

Firefox by default designates certain form input fields as important by giving them a yellow backgroundFor those that do a lot of work in interface design, this won’t necessarily be a new trick. However this could prove quite useful for those new to designing forms with css.

There is a bug within firefox that turns commonly important fields yellow (such as name, email or phone).

The simpliest way around the matter is to designate your input background as important. In the example below, the style is regarding all input tags.

input {
background:#fff !important;
}

Hope this helps!

jQuery turns 3 with the release of jQuery 1.3

Friday, January 16th, 2009

jQuery
January 14th, 2006 brought to the development world what would soon become one of the most influential javascript frameworks.  jQuery, the write less, do more framework, has since taken on a life of its own and is now used by many web sites today, from Google, to Dell, and even Virginia Tech.

Happy Birthday jQuery!

Styling Nested List Items With CSS

Thursday, September 25th, 2008

Many years ago designers overlooked an important piece of the pie known as efficient web design - the use of lists. As the years progressed, this overlooked portion began to take shape as an art form and started to show the world the power it could harness to make the web a more manageable place.

With that mouthful, let us move on to see how we can use CSS to nest lists!

First and foremost - keep your list CSS in one CSS file

One issue I’ve seen from working with premade layouts is that some have various stylesheets and each have classes and selectors pertaining to the same list items. In reason, it can be assumed that you may want to seperate these stylesheets to operate with different browsers (such as IE6 or IE7 while using the and conditional statements for Internet Explorer 7 and Pre Internet Explorer 7 respectively). However, there really shouldn’t be a big hassle between the browsers in terms of lists. For example:

body {}
ul
{
list-style:square;
}
/*We shall create css to format interior lists, going 3 deep from the root*/
ul li ul,
ul li ul li ul,
ul li ul li ul li ul
{
padding-top:10px;
list-style: url('../images/mapbrack.gif');
}

In our css, we have defined styles for ul selector. From there we have moved on to specify styles for more intense DOM structure, such as nested lists.

The HTML could look like the below example:


<ul>
<li><a href="#"><a href="#">Test</a></a></li>
<li><a href="#">Test 2</a></li>
<li><a href="#">Test Group
<ul>
<li><a href="#">Inner Test 1</a></li>
<li><a href="#">Inner Test 2</a></li>
<li><a href="#"> Inner Test 3
<ul>
<li><a href="#">Inside Inner Test 1
<ul>
<li><a href="#">Last Test 1</a></li>
<li><a href="#">Last Test 2</a></li>
<li><a href="#">Last Test 3</a></li>
</ul>
</a></li>
</ul>
</a></li>
<li><a href="#">Inner Test 4</a></li>
</ul>
</a></li>
<li><a href="#">Test 4</a></li>
<li><a href="#">Test 5</a></li>
</ul>

As you can see we have did quite a number on nested lists. Not only do we have one nested list, but we have created nested lists within nested lists that will gracefully stretch across IE, Firefox, and Safari. The result is that you have optimized your css to limit the amount of code to render and produce the same result. You can look at it as trimming the fat off of the CSS, or you can look at it as just one small step in saving resources.

Simple Javascript to Combat Spam

Monday, August 25th, 2008

Before you read any further, take into context this isn’t going to fully help you in terms of lessening your spam. However, it is a neat trick and will help some, or at least deter some spamming bots from picking your e-mail address and using it for spam.

While at work today I was performing some maintenance on a project that was handed to me and I noticed a tiny bit of javascript used to print an e-mail address, but by doing so kept it seperate and not connected.

<script type="text/javascript">
    emailE=('roberthash@' + 'yahoo.com')
    document.write('<A href="mailto:' + emailE + '">' + emailE + '</a>')
</script>

What you see first is that a variable is assigned two values that are added together. By splitting the e-mail into two pieces (in theory), this will assist in deterring spam bots searching for a valid e-mail address.

emailE=('roberthash@' + 'yahoo.com')

From there we utilize the document.write() function to print this text to the browser window.

document.write('<A href="mailto:' + emailE + '">' + emailE + '</a>')

Another beautiful part is that if Javascript is not installed, this means there won’t be an e-mail address showcased. However, this could be a pain if you have someone trying to find your e-mail address that has a legit reason to contact you - but doesn’t have Javascript.

As usual, it is a method to be used at your own risk or if you feel it is indeed the solution for your project.

With further research, I have found the origination of this code, which can be found at http://www.joemaller.com/js-mailer.shtml.

As you can see - it is a very simple approach that even a novice programmer can understand. Who says you can’t learn new tricks?

XHTML Tags

Friday, August 22nd, 2008

Here is a listing of XHTML tags that I’ve kept as a reference for a long time. I figure if they were a great resource when I was learning XHTML, then they can be a great resource for you as well.

*Original credit goes to http://www.w3schools.com/tags/default.asp*

XHTML Tags, Description and Document Type Declaration


Tag Description DTD
<!–…–> Defines a comment STF
<!DOCTYPE> Defines the document type STF
<a> Defines an anchor STF
<abbr> Defines an abbreviation STF
<acronym> Defines an acronym STF
<address> Defines an address element STF
<applet> Deprecated. Defines an applet TF
<area> Defines an area inside an image map STF
<b> Defines bold text STF
<base> Defines a base URL for all the links in a page STF
<basefont> Deprecated. Defines a base font TF
<bdo> Defines the direction of text display STF
<big> Defines big text STF
<blockquote> Defines a long quotation STF
<body> Defines the body element STF
<br> Inserts a single line break STF
<button> Defines a push button STF
<caption> Defines a table caption STF
<center> Deprecated. Defines centered text TF
<cite> Defines a citation STF
<code> Defines computer code text STF
<col> Defines attributes for table columns STF
<colgroup> Defines groups of table columns STF
<dd> Defines a definition description STF
<del> Defines deleted text STF
<dir> Deprecated. Defines a directory list TF
<div> Defines a section in a document STF
<dfn> Defines a definition term STF
<dl> Defines a definition list STF
<dt> Defines a definition term STF
<em> Defines emphasized text STF
<fieldset> Defines a fieldset STF
<font> Deprecated. Defines text font, size, and color TF
<form> Defines a form STF
<frame> Defines a sub window (a frame) F
<frameset> Defines a set of frames F
<h1> to <h6> Defines header 1 to header 6 STF
<head> Defines information about the document STF
<hr> Defines a horizontal rule STF
<html> Defines an html document STF
<i> Defines italic text STF
<iframe> Defines an inline sub window (frame) TF
<img> Defines an image STF
<input> Defines an input field STF
<ins> Defines inserted text STF
<isindex> Deprecated. Defines a single-line input field TF
<kbd> Defines keyboard text STF
<label> Defines a label for a form control STF
<legend> Defines a title in a fieldset STF
<li> Defines a list item STF
<link> Defines a resource reference STF
<map> Defines an image map STF
<menu> Deprecated. Defines a menu list TF
<meta> Defines meta information STF
<noframes> Defines a noframe section TF
<noscript> Defines a noscript section STF
<object> Defines an embedded object STF
<ol> Defines an ordered list STF
<optgroup> Defines an option group STF
<option> Defines an option in a drop-down list STF
<p> Defines a paragraph STF
<param> Defines a parameter for an object STF
<pre> Defines preformatted text STF
<q> Defines a short quotation STF
<s> Deprecated. Defines strikethrough text TF
<samp> Defines sample computer code STF
<script> Defines a script STF
<select> Defines a selectable list STF
<small> Defines small text STF
<span> Defines a section in a document STF
<strike> Deprecated. Defines strikethrough text TF
<strong> Defines strong text STF
<style> Defines a style definition STF
<sub> Defines subscripted text STF
<sup> Defines superscripted text STF
<table> Defines a table STF
<tbody> Defines a table body STF
<td> Defines a table cell STF
<textarea> Defines a text area STF
<tfoot> Defines a table footer STF
<th> Defines a table header STF
<thead> Defines a table header STF
<title> Defines the document title STF
<tr> Defines a table row STF
<tt> Defines teletype text STF
<u> Deprecated. Defines underlined text TF
<ul> Defines an unordered list STF
<var> Defines a variable STF
<xmp> Deprecated. Defines preformatted text

3 Crucial User Interface Errors

Friday, August 22nd, 2008

As a designer you can run into a lot of conflicts. What do I think looks the best? What do they think looks the best? I understand this but will they be able to comprehend? These are all valuable questions that designers face. For that, I am going into 3 common areas in which most designers either take sink or swim!

1) Assuming the User Understands
I don’t have the statistical research, but this is one of the biggest problems designers face today. As developers and designers we tend to take our own knowledge of what we understand for granted. Do all users know this type of link goes here? Is it common knowledge a house means that you will go to the index or home page?

Take into deep consideration how much your design speaks to the user. It is a safe route to break down navigation as simple as possible, add visulizations and tool-tips where needed, and to place objects where users can easily see them.

All and all - your design should tell the user what to do. That tends to eliminate the confusion.

2) Small Text Sucks. Period!
One of the biggest issues I have with design is small text. It could be the fact that I’m very close to being legally blind. Just think about it. Your site or application is used by the 17-50 year-old range. Will all of your users have the same eye sight? Will they even look at your site on the same screen resolution? This was especially an issue during the Dot Com days as Verdana with font-size 10px being the forerunner. Now, bigger text is in with the whole Web 2.0 movement.

Of course - your users could probably utilize the zoom feature in their browser. How convenient is that though? Remember folks - this is all about the user experience!

3) Your Browser Isn’t The Only One Bud
I really didn’t think it was such a problem ,but there are many designers that don’t think to test their applications in various browsers. This site is included! There are some subtle differences between all browsers that can hamper the user experience. It may seem like the tiniest fragment but trust me - it will hurt a lot more than you imagine.

Test, Test, Test! That’s the only way you can assure that your site is your site no matter the environment.

And we close…..
Those are three elements that can be overlooked, assumed, or can even lack the proper attention. Remember - every element put into your web site/ applicaiton interface dictate how your users will effectively use it. Your users can use it proudly. Yet again, they can move on to the next search result due to frustration.

Png Fix for IE 6.0

Friday, August 22nd, 2008

For those of us that enjoy using PNG graphics in our layouts, it is common knowledge that Internet Explorer is a point of frustration in the entire process.

Fortunately javascript can be utilized to assist in this matter. Be sure to use the defer type.

<html>
<head>
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->
</head>
<body>

For an example of the javascript one could use to show the PNG format in IE6, check out the link below:

ASP.NET .. Meet AJAX

Thursday, August 9th, 2007

At work I’ve been working with our developer to create a report for our agents to track some of their call/sales data.

This form is trick because of the amount of information that it will be obtaining. In some ways it is easy, but the flowchart itself provides a lot of forks in the road.

The form will be dynamic, with some of the fields populating from a database table. When agents answer specific items with “Yes”, a window will appear with more options. Vice versa, if they answer “No” then another window will glide in. This will obviously be done with AJAX. I just hope the dataflow is an easy process. In all reality, this will be my biggest AJAX project since I started toying with it earlier this year.

At the moment I have designed 90% of the layout. From here it will be on to the table creation for the database, creating the javascript to work options in the form, and finally on to the ASP.NET controls for interacting with the database.

ASP.NET has been a smooth transition. I feel I am picking it up much faster than originally thought. I respect the technology now, it’s no PHP in my eyes, but it definitely packs a violent punch that delivers results!

*In NO WAY SHAPE OR FORM was that a pun directed at the company I work for… haha*