Web Development

Up

Doctypes

HTML 4.0.1 Strict

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

HTML 4.0.1 Transitional

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

HTML 4.0.1 Frameset

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">	

XML 1.0 Strict

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

XML 1.0 Transitional

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

XML 1.0 Frameset

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

Combining MochiKit and Dojo

MochiKit makes JavaScript suck less. Dojo is another JavaScript library that has some really great widgets. To use them together in a way that works with all browsers you must do this:

	<script src="/media/dojo.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" charset="utf-8">
	        dojo.registerModulePath("MochiKit", "/media/MochiKit"); 
                dojo.require("MochiKit.MochiKit");
		dojo.require("dojo.widget.Button");		
		dojo.require("dojo.widget.Dialog");
	</script>   
	<script src="/media/js/site.js" type="text/javascript" charset="utf-8"></script>

Of course, you would edit the paths to be appropriate for your site. The downside is that you have to use fully-qualified namespaces for everything. For example MochiKit.DOM.$('my_element_id'), not $('my_element_id'). Note also the syntax for including things from Dojo that are not automatically compiled in to the build your have installed.

Canvas

The Safari browser (version 2 and newer) and the Firefox browser (version 1.5 and newer) now support the <canvas> tag, which lets you do live drawing from within a web browser without the user of any outside technologies. If you are running one of these browsers, check out my first attempt at coding a <canvas> tag:

Miscellaneous Stuff


Page last modified on November 08, 2007, at 09:11 AM