dans.blog


The miscellaneous ramblings and thoughts of Dan G. Switzer, II

Creating Dynamic "onload" Events Using JavaScript

I posted a new article to PengoWorks.com today that shows a technique for running multiple onload events without altering your base source code. Here's a quote:

One of the most common things I run into while developing sites dependant on JavaScript is the need to have multiple operations run during <body>'s onload event. I think this is a problem most developers run into, since it's very common to develop a set of "shared border" templates that render the shell of your site and the body of your document is included via a server-side command.

Often you have the need to invoke some JavaScript during the onload event of every page. This might be to render a DHTML-based menu, or simply to initial some information about the page, regardless, you need this information to run on every page.

However, you often run into the case were you need to run some addition commands based upon the page that's being inserted. Most often this happens when I'm developing a page that has a form on it. There are a lot of ways to tackle this problem, but the tip I'm going to share with you is the one that I've found over the years to be the best solution. For a lack of a better term, I'll call this the "Auto-init()" method.

If you have any comments about the article, please post a comment!


Jessica Lynch Update...

Jessica Lynch, the most famous soldier of the war, remains in a private room at the end of a hall on an upper floor of Walter Reed Army Medical Center, her door guarded by a military police officer.

To repair the fractures, a spinal injury and other injuries suffered during her ordeal, the 20-year-old private first class undergoes a daily round of physical therapy. But she does so alone, during the lunch hours, when other patients are not admitted.


Band Update: Practice Last Night...

I was hoping to post this early, but I've been extremely busy at work lately. Anyway, we had band practice again last night. We hadn't played in two weeks, because Todd had a cold. We're definitely getting better by leaps and bounds—but I can definitely tell the difference when we miss a week of practice. I've really got to work on Van Halen's Panama though, that's definitely the tune that gives me the biggest problem.


Michael Moore Hates America: The Movie...

Robi had a good post on his blog about the Michael Moore Hates America website. Sounds like a good idea for a movie to me! Go read Robi's post now!


Nine Degrees of Backstage Tourbulence Update...

The guys at the German Fanclub for Dream Theater have released up to part seven of their behind the scenes video series Nine Degrees of Backstage Tourbulence. Only two more parts to go!

It's been a pretty interesting series so far, if you're in to music (especially playing life) you might enjoy the series even if you're not a fan of Dream Theater. I just downloaded parts 6 & 7, so I'll probably watch them later today.


Neverwinter Nights: Shadows of Undrentide Trailer...

Bioware has released the movie they demoed at E3 with game footage of Shadows of Undrentide—the new extension pack for Neverwinter Nights. The video is about 10 minutes long and walks through the new features, skills, creatures, spells, etc that were introduced in the game.

Shadows of Undrentide Trailer


Half-life 2 Trailer...

Ok, today's "Video Link Day". There's a couple of links to media files I've been meaning to post.

Valve Software recently released some in game footage from the Half-Life 2 engine—talk about gorgeous! If you haven't seen the footage yet, go download a copy of the video from my ftp server. This game has some of the most realistic backgrounds I've seen. The environment visuals look very, very good.

Half-Life 2 DivX Trailer


Weekend Getaway Planned!!!

Well this afternoon I booked a cabin down in the Hocking Hills area (in Logan, OH) at a place called Acorn Acres.

I've never been there—I found the place on the web. The lady I talked to sounded nice enough though, and it had the ammendities Jenn & I were looking for. We've been talking about trying to get away for the weekend and this place seems to fit the bill. The cabin does allow for dogs, so we're taking Maddie. I was hoping to find a cabin right on the water, but Lake Logan is supposed to be just down the road, so hopefully we can take her swimming there. If not, there are several other lakes in the area, including Lake Hope.

The place is supposed to only be a couple of miles from Old Man's Cave—which is a place I've always wanted to visit, but just never gotten around to it. I definitely think we'll get there either Saturday or Sunday—provided the weather isn't horrible. Anyway, I'm looking forward to this weekend. I've been needing a mini-vacation.


Father's Day Weekend...

Well, another weekend's over—sometimes I wish weekends were longer than 2 days. :) Anyway, didn't do much on Saturday, did a little bit of yard work, but my lawn was drenched, so I didn't want to mow the grass. Just walking through the yard you'd see small splashes of water with each step. Unfortunately, it's crappy outside again, so I doubt I'll be able to cut the grass tonight either. (We're supposed to have band practice tonight, and I wouldn't have to time to cut the grass if we jam anyway, so I guess that's good.) I watched a couple of MLS Soccer games, but that was pretty much the extent of my day. :)

I didn't get much sleep Saturday night. Someone in the neighborhood was having a party and at 4am they were still blasting—let me tell you, it was loud too, way too loud for 4am and being outside. I almost yelled something at them when I let Maddie out to go potty at 4am, and then I realized what an old geezer I'd become and decided just to go inside. The sad part is, I think the lady holding the party is 5-10 years older than I am. I hope I don't become an old miser. :)

Anyway, since I didn't get much sleep I ended up sleeping in too late and missed breakfast w/my parents and grandparents. I was supposed to meet them at Northwood Hill CC in Springfield at 9:30, and didn't wake up until 9:18. Thankfully, Jenn came in the room and woke me up, otherwise who knows when I would have gotten up.

more…


Jenn's Blog

Ok, as you can see in my list of blogs in the nav bar, Jenn's decided she's going to join the blogging world. :) She set her blog up this morning on blog*spot and I tweaked her template a bit this afternoon. So, if you're interest in the world of my girlfriend, make sure to check out Jenn's Blog.


Jakks TV: Atari, Namco, Activision and more!

Looking for more classic gaming at a relatively low cost? Then check out Jakks TV. I've got to say, the Namco looks like the best one, I just wish they would have included Galaga instead of Galaxian. Anyway, you should be able to pick these up for under $30, I even saw the Atari unit for under $20—of course it's been out for 6 months. Anyway, they should be very cool cheap novelty toys.


Good reading over at Robi's Blog...

Robi's had a couple of good posts on his blog site as of late (well, he normally has good stuff on there, I recommend reading his blog daily.) Make sure to at least read the following couple of blog entries:

More on the missing 727 from Angola
More Commentary from G (about current life in Baghdad)
MoveOn.org Email Cause Me To Opine


Jenn, Her Foot and a Fire Extinguisher...

Ok, so yesterday was an interesting day. At 2:42pm I get a call from Jenn. She apparently was walking to ladies bathroom at work and bumped into the fire extinguisher on the wall and fell of and hit her square on the right foot. I took off from work to pick her up and take her to the ER. Fortunately, she works at a medical supply chain, so they were able to lend her some crutches on the spot.

We went from her work straight to St. Anne's ER room. They weren't terribly busy and we only waited like 45 minutes before getting back called back for the exam. The hospital did all there paperwork and then they wheeled her back to take the X-Ray. Fortunately, I had my Gameboy Advance SP with me, so I just played for the couple minutes it took for them to take the X-Ray.

Fortunately it doesn't look like she broke anything, although we've yet to hear back from the radiologist to confirm the ER doctors initial findings. They told Jenn to stay home from work until Tuesday and just to try to stay off of it as much as she can. They also gave her some Percocet to ease the pain. She seemed to be doing ok this afternoon, but the last time I talked to her she had just taking some Percocet, so she sounded pretty tired (and she was getting ready to take a nap.)

more…


President Rides Segway...

Nice to know we have a president who can stay on his feet. Ok, so he didn't look all that graceful in the process, but at least he kept his balance! :) I've got to admit, I'd really like to ride one of these things just to see what it's like.

story.segway.fall.ap.jpg

Arriving at the family's oceanside estate, the younger Bush quickly shed the suit and tie for casual wear, grabbed a tennis racket and whacked an orange ball for dog Spot to fetch. The president was still clutching the racket when he boarded a Segway, a standup, motorized scooter that resembles a push lawnmower.

The Segway went down on Bush's first attempt, but he stayed on his feet with a flying leap over the machine. Undeterred, he got on again. His father climbed on a second Segway and they cruised around the driveway at the estate at Walker's Point.

Thanks to Robi for the link. :)


Macromedia "Royale" Announced

Well, Macromedia has finally announced "publically" announced their "Royale Initiative." There's not much there, but the FAQ does cover some very basic questions I've heard asked. I really wonder how close the stuff Macromedia is working on will resemble what Laszlo Systems has been working on.

I've been very intrigued by their product since I first saw their idea. I like the idea of XML In, Flash Out. If you haven't seen what the Laszlo Presentation Server can do, go check out their demo page. The XML Editing demo actually allows you to view the XML used to generate the demo. You can even change the XML around and view your change on-the-fly!

I originally blogged about Royale back on March 28, 2003. I does appear that Royale may be a little more than a fancy form generation tool. I'm really interested to see what they come with.