Changes

Jump to: navigation, search

BTC640/ProcessingPrereq

1,713 bytes added, 10:08, 30 December 2011
no edit summary
What makes HTML XHTML is more strict rules about how tags are used, and stricter (but not enforced) rules about formatting.
In XHTML formatting is preferably done using CSS. We'll look at some CSS examples.
== JavaScript, DOM ==
This trivial programming language has become quite important, and can be quite complex. We will not need to learn the most complicated things about JS such as closures, but we'll need a good working knowledge of the language.
 
Basics: <script> tags, .js files, alerts, variables, conditions, for and for..in loops, data types, pass by value and pass by reference.
 
Tools: the Firefox error console, firebug.
 
More serious work can be done with JS when using DOM methods. We can manipulate, create, show, hide, move almost anything on a webpage using JS and the DOM.
 
Browser compatibility: used to be a very serious issue, with IE not supporting any standards. These days all the recent versions of desktop web browsers support pretty much the same technologies. We have a new problem though, and that's mobile devices. Often mobile browsers, even if capable of interpreting JS, have it turned off to save bandwidth.
 
== Java ==
 
The Processing language is actually a wrapper around Java, so most things that work in Java will work in Processing. If you're working on porting an existing Processing project over to Processing.js you have to understand enough Java to know what the original author was trying to do.
 
Processing.js itself is a kind of translator - it reads Processing (Java) code and coverts it to JavaScript code. This is possible to do to an extent and many Processing apps will run just fine in Processing.js but there are differences that can require porting work. For example there are no data types in JS, so if your Java logic depends on data types (e.g. integer rounding) you will need to modify that code to work in JS.
= References =
* http://en.wikipedia.org/wiki/Html_tags
* http://www.quirksmode.org/dom/w3c_core.html

Navigation menu