JavaScript

  1. Home
  2. Computing & Technology
  3. JavaScript

What JavaScript Can't Do

JavaScript cannot do everything that you might like. Some of this is due to where the JavaScript is running and other limitations are for security reasons.

Fixing JavaScript Errors

Stephen's JavaScript Blog

Display Table Borders Bookmarklet

Thursday March 12, 2009
Getting rid of layout tables from your HTML makes yhour page more semantically correct.

Everyone who hasn't been living under a rock for the past 10 years knows that you should use CSS to do your page layout and not use tables in your HTML. HTML tables are intended for tabular data and their use for doing page layouts was a 20th Century aberation caused by the delay in introducing support for CSS. With IE8 all the latest browser versions now support the CSS table commands anyway and so where a grid layoutr is needed you can easily do it in CSS provided that support for IE7 and earlier isn't needed. Of course CSS also provides other alternatives so that using tables for layout in your HTML isn't required even if you do need to support antiquated browsers such as IE7.

The problem is to tell which pages you have updated to get rid of the layout tables and whichare yet to be fixed. Well that's where this JavaScript bookmarklet can help. This particular JavaScript bookmarklet will make all the table browsers in the web page visaible by using JavaScript to change the borders attribute on all the tables to 1. This allows you to check for where the tables are in the web page. Those that contain tabular data can then be left alone while you concentrate on getting rid of all those tables that shouldn't be there now that browsers such as IE6 and more modern browsers support sufficient CSS commands to make layout tables in the HTML unnecessary. As mentioned before, the modern ones even allow you to use display:table etc in the CSS to do table layouts with your semantic HTML.

Display Table Borders Bookmarklet

Extending Objects

Wednesday March 11, 2009
When JavaScript doesn't provide the method you need you can add it yourself.

In the last few modern JavaScript tutorials we have looked at the many different objects that JavaScript defines for us to use with our JavaScript code. We are not just limited to those methods that JavaScript provides for those objects though because JavaScript allows us to extend the functionality of any object at any time simply by defining additional methods of our own. In the twentieth modern JavaScript tutorial we look at how you can extend the functioning of the built-in objects. This tutorial includes six examples of how to extend date objects and one of how to extend string objects.

Extending Objects

Onload and the DOM

Tuesday March 10, 2009

Who can read next month's magazine before it is delivered to the shops? No one other than the people who work for the magazine. In the same way JavaScript can't access elements within the web page until after they are downloaded.

There are two common problems that people have when it comes to the load event. Either they have two scripts each with their own onload and they don't know why only one will work or they don't use an onload event handler at all and wonder why document.getElementById fails when they can see the id right there in their copy of the page.

Onload and the DOM

"Professional Javascript for Web Developers"

Monday March 9, 2009
Experienced programmers have a different approach to learning JavaScript

While most beginners to JavaScript need to learn the basics of programming as well as how to apply that to JavaScript, experienced programmers already know what they want to achieve and just want to learn how to do it using JavaScript. Three years ago the first edition of this book provided these programmers with the resource they needed. The second edition has just been released and has been significantly rewritten and expanded.

"Professional Javascript for Web Developers"

Discuss

Community Forum

Explore JavaScript

More from About.com

Build Your Own Website

Easy guides to creating your own blog, online photo album or wiki.

Connect Your Home Computers

Easy ways to connect two computers for networking purposes.

JavaScript

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.