Ajax
Working up to AJAX by learning something about the DOM and Javascript
If you’re not in the programming field, you likely got hit by a bunch of acronyms there as if you had been hit by a bus. Let me break it down:
AJAX : A technique that makes websites look fast and smooth, unlike “old” style application. Think about the way Google maps looks, or Netflix. DOM: HTML (the language that web pages are written in) can be seen as a “tree-like” structure. This structure goes by the name of “DOM”, or “Document Object Model” Javascript: A language for telling your browser ( Firefox, IE, etc. ), to do something to the HTML page sent from the server *within your browser.
Going further with JavaScript and the DOM
One of the main things that really blows programmers’ minds when they really see the power of it is a topic called ‘closures’ or ‘lambda functions’ or ‘anonymous subroutines’.
I decided to edit the previous post’s code to use closures, to get the hang of this technique in JavaScript. It makes your code a lot more flexible as I think the simple example below demonstrates.
For the code, look after the jump…
Making some progress with JavaScript menus
As I posted earlier, I’m undertaking to better understand the basics of the DOM, Javascript, and DHTML on my pilgrimage to being Ajax competent. I’m using Ajax in Action as my guide.
Recently at work, we had need of a basic ‘dashboard’. It’s a pretty simple design: boxes on the left with one level of drop down for menus, a big, central ‘content’ section in the middle.
I was thinking of how I wanted to implement this.
- It needed to be flexible (i.e. layout should be described in an XML file)
- It needed to be updatable without touching the JavaScript (to get a feel for the Ajax design)
- It needed to be somewhat visually appealing.
The goal was to use Javascript to create a 100% DOM rendered page that worked in IE and Firefox.
Here’s how I did it after the jump….
Big Nerd Ranch: RoR Camp: Day 3: Evening: "The Grinder"
Hi all,
After the lengthy tour of duty yesterday, I’m back in for another lengthy day. I think that Wednesday is really the grinder day.
First, you’ve been lectured to for the last 3 days. There are very few minds that can take 8hr. / day lectures without feeling a bit tapioca-ish on the 24th hour.
Secondly, you’re listening and then working very hard on something that you just were introduced to. You have these head bashing against a wall sessions and then, suddenly, you’re set free ( because you’re doing something that’s old hat, something you learned, say, that morning ) and then you hit the wall with all that built-up acceleration.
Big Nerd Ranch: RoR Camp: Day 3 (cont’d): Evening: "The fatigue"
Yesterday’s post looks a little incoherent with a day of rest between it and I. Based on the entreaty of Mr. Graitcer in the comments, I thought that perhaps I could try to characterize what it is to be fatigued in this way.
First, let’s just say that it’s not the expectation of the teacher or the class curriculum that you work yourself into fatigue of this type. It’s not necessary or required. Yet in both of the BNR classes I’ve taken, the students worked late into the night on their own projects, or improving the assignments.
Therefore, the motivation to work to this level of fatigue is not extrinsic, it is clearly intrinsic.
Misuse of JavaScript annoys me
IMDB’s image provider has implemented the classic way of preventing image stealing: return false for the right-click or contextMenu event.
This annoys me so much.
And it’s so trivially easy to subvert, it just irritates me that this qualifies as security and / or is demanded by clients. A demonstration should suffice. In these examples, IMDB tries to prevent me from grabbing images out of their pictures tool. Sigh. Must it be so?
So, please, stop. Just stop. Because you don’t stop the slightly-enlightened from getting the goodies: