It’s Good to be Smart

I recently purchased a wireless ethernet USB adapter from D-Link – the DWL-122 to be exact.

It turns out that the item was defective, and I called customer support to get an RMA number to return the adapter. I went through all the hoops that I despise, even though I know that the customer support people are required to go down a list of things that probably aren’t wrong, just in case they can find a way to place the blame on you, your network, your power, your cat, etc. [there’s a pat-on-the-back bounty for anyone who can find that online article that was all about this dude at a customer support center revealing all the different strategies people around the call center used to get people off the phone].

Anyhow, I finally went through all the foolish things I had to do (including, but not limited to, power-cycling my wireless router, which was currently working with the built-in Wi-Fi adapter in my laptop) and was given a case number. That case number is used to fill-out an online RMA request. You go to the D-Link website and enter in all you information (including the case number) and boom: they give you a bar-coded form that you print and include with your return so they know why you’re sending them a package.

There’s only one problem: there’s a step in the process where you have to choose between a “Replacement” return (where you send the item back, and they send you a replacement once they’ve tested it or whatever) and a “Cross Shipment” return (where they sell you a new one, then reimburse you when they get the defective item). That step was a roadblock, since neither big, throbbing button on the page actually does anything. Nope. Nothing. Nada.

Since I’m Smart™ (and I use Mozilla Firefox, further contributing to my Smart™ quotient), I popped-open my trusty Javascript console to see what was going on (things like this are often Javascript-related). Sure enough, some programmer had coded illegal HTML which resulted in Javascript that simply wouldn’t execute.

Let me take this opportunity to rant about Javascript in browsers. In fact, let’s do that in another post.

Looking at the HTML source code for this page revealed that the button fired-off a Javascript call which should have set the action for a <form> element and then submitted the form. Unfortunately, the form was defined after the entire page, including the </html> element. Maybe it was just Firefox’s propensity to — uh, I dunno — comply with HTML rules, but you can’t define anything useful outside of the page boundary.

The Javascript console told me: 'confirmed' is not defined, because the form (called ‘confirmed’) was not defined within the page. Makes sense. However, it was obvious what the form was trying to do, so I copied the source code for the form, added a submit button and the action attribute myself (helpfully provided by the Javascript code), loaded the hacked form in another window, and submitted the form, and continued with the RMA process.

Chris: 1
Teh Intarweb: 0

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: