Tuesday, August 21, 2007

Operation Aborted - dang Javascript!

There I was, innocently coding away at my Portal App in RAD 7, Portal 5.1, when suddenly my app refused to load in the browser any more.

Click "OK" on this dialog and I go straight to "The page cannot be displayed".

No error messages in the logs. Could this be a Javascript issue? Of course, I didn't get around to asking myself this question until I had uninstalled my EAR file twice, re-booted and re-created the server. *sigh*

I noticed that when the above dialog shows, IE 6.0 was also showing the exclamation mark icon in the bottom left hand corder indicating a Javascript error, but I couldn't get to see the error because it would divert to "The page cannot be displayed". So, I turned on rude Javascript notifications (I.E. 6.0): Tools > Internet Options > Advanced > Display a notification about every script error.

When I re-loaded the page, I saw a Javascript error alert first complaining about a missing semi-colon.

After that one, I got the "Operation Aborted" dialog. When I investigated I found the results of some very sloppy c&p on my behalf. The last line in the code below begins with a "+" ... syntax error.

if (theField) {
  theField.focus();
}

+ theField.name + " value: [" + theField.value

The point is that "Operation Aborted" should mean a really bad client side (Javascript) error rather than a really bad server side error.

No comments: