Weird Thoughts From Eric's Head

Categories : All | AJAX | BUSINESS | PERSONAL | PROGRAMMING | BOOK REVIEW

Ajax: Pop Up Blockers are an Ajax Developer Problem?

Well pop up blockers have been known to drive developers insane when they block windows that are needed in the application. Well I just found out that some pop up blockers are destroying the lives of Ajax Developers too. I never thought that would be the case until I saw it with my own eyes.

As I always mention, I write all of the clientside errors to the server log on my application so I can spot problems that I would never see. The other week I saw an error message saying I had a bad response from the server. This check is a regular expression that expects a correct format from the server. When it detects an incorrect format it dumps the message to the log.

So in my log I see the error message and responseText string returned from the server. To my surprise I saw a wonderful injected code of a pop up blocker. The pop up blocker which I could identify was the Proxomitron Anti-popup code. The other blocker code I saw was too generic to determine what one it was.

So that means if you are expecting a certain format to be returned from the server, it may not be the case since a pop up blocker may inject code into the XHR response. That is why I stress you have to validate the data coming from your server on the client before using it. Make sure it is what you expect!

This is just one more thing to add to your plate when you are developing an Ajax application. Outside parameters you can not test for and can not control, but do affect your user’s experiences.



Eric Pascarello
Coauthor of Ajax In Action
Moderator of HTML/JavaScript at www.JavaRanch.com
Author of: JavaScript: Your Visual Blueprint for Dynamic Web Pages

Permalink
[AJAX] [PROGRAMMING]
Ajax: Session Warning to Developers
Your application probably has one of these problems!

Ajax: Session Warning to Developers

One thing that you have to think about when developing an Ajax application is the user's session. Now there are two ways it can bite you in the butt. With first hand experience, I have seen these in other people’s applications and mine. Why it is a warning? They can cause some major problems if we do not account for them. Problem 1 can lead to security issues with a long lunch break and Problem 2 can just leave a user hanging wondering why the clicking the button 20 times did nothing!

Your application probably has one of these problems! So you better keep reading to find out what causes these problems and how to fix them.

Read more...

Ajax Talk: Baltimore, Maryland on March 07, 2006 at 6:30 PM

I will be speaking at Central Maryland Association of .NET Professionals (CMAP) on Tuesday, March 07, 2006 at 6:30 PM in Baltimore, Maryland. For more information and directions you can visit their website http://www.cmap-online.org/Meetings/Details/2006-03-07.aspx.

I will touch on the XMLHttpRequest Object, my refreshing panels example, my double combo example, security, business logic, caching, OOP JavaScript, and much more. If they would let me talk to midnight, I would!

My last talk in Washington DC was a success and I plan on keeping that way! Come and try to win copies of my books and other items that CMAP has! (AND they have free pizza!! I am a sucker for pizza!!) Bring on your questions because that is what makes these meetings interesting. If you have either of my books, feel free to bring them and I will sign them. (may reduce the price of the book, but you never know! LOL)

Thanks for your support and hope to see you there.

Eric Pascarello
Coauthor of Ajax In Action
Moderator of HTML/JavaScript at www.JavaRanch.com
Author of: JavaScript: Your Visual Blueprint for Dynamic Web Pages

Ajax: My Question and Answer Session with Colleen Frye

I had Question and Answer session with Colleen Frye for SearchWebServices.com. The article talks about Ajax security vulnerabilities, which is a rather hot topic lately. I think people are more afraid then they need to be. Check out the article: http://searchwebservices.techtarget.com/qna/0,289202,sid26_gci1164745,00.html

Eric Pascarello
Coauthor of Ajax In Action
Moderator of HTML/JavaScript at www.JavaRanch.com
Author of: JavaScript: Your Visual Blueprint for Dynamic Web Pages

Ajax: IE and Mozilla Errors you need to know about

If you are logging clientside errors, your may see two errors show up with Ajax applications. The first error is with IE: "Automation server can't create object" and the second error was Mozilla: "NS_ERROR_NOT_AVAILABLE". Now I will tell you what causes them.

Automation server can't create object

Well this error commonly will show up with IE6.0 in your logs. This is a really simple error to reproduce. Set your security level to high and then enable active scripting (JavaScript). Run your application. If you get an error, that means you are not using try catches when you are setting the ActiveX object. So if you see this error you just need to add try catches around your declaration. Basic example is below:

try{
      this.req=new ActiveXObject("Microsoft.XMLHTTP");
    }
catch(e){

}

NS_ERROR_NOT_AVAILABLE

This error took a little investigation on my part. So I did a search on bugzilla and came up with this link:https://bugzilla.mozilla.org/show_bug.cgi?id=238559#c0

So you do not have to search through the whole page I posted the problem with Mozilla and why it causes the error:

<quote from https://bugzilla.mozilla.org/show_bug.cgi?id=238559#c0>

Mozilla calls onload() for all HTTP transactions that succeeded. The only
time it calls onerror() is when a network error happened. Inside the onerror
handler, accessing the status attribute results in this exception:

Error: [Exception... "Component returned failure code: 0x80040111
(NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]"  nsresult: "0x80040111
(NS_ERROR_NOT_AVAILABLE)"  location: "JS frame ::
file:///Users/chuck/errtest.html :: anonymous :: line 114"  data: no]
Source File: file:///Users/chuck/errtest.html
Line: 114
</quote>

Now an easy fix for now is to add another try catch in your onerror function when you are reading the status property. This will stop the error occuring, but thanks to this, you will not have all of the information that you could have with IE.

Error Handling

On of the best things you can do is implement error handling on your clientside applications. Logging them to the server can let you spot problems that you may never see. You may never new about these errors on your site if they never came up in testing. Logging problems will allow you to see them. I am doing a talk on this at The Ajax Experience in May.



Eric Pascarello
Coauthor of Ajax In Action
Moderator of HTML/JavaScript at www.JavaRanch.com
Author of: JavaScript: Your Visual Blueprint for Dynamic Web Pages

The JavaScript "Sucks" Conversation

The other day I had a conversation (more of I think I am better than you rant) about how JavaScript needs to be a "real" language. The person in my mind had no clue what JavaScript's real potential was when you sat down and looked at it. I remained calm and chuckled to myself inside.

Well I listened to his 2 cents and sum his five minute rant into one sentence. "JavaScript's 'loose' variables are evil, JavaScript’s OO is not OO, and the standards are to slow to adapt with browsers.

Well my response back went something like this:

Read more...

The Ajax Experience: Posted my topic.

If you already did not hear the big news, I will be presenting at the The Ajax Experience in San Francisco May 10-12, 2006. This will be the biggest conference on Ajax with the biggest names and some great topics are being discussed and I can not wait to listen to some of them! When I had to come up with my talk I wanted to do something orginal. After banging my head on my "wall of thoughts" (nerd version of mirror mirror on the wall). I thought I would do something that I actually use in a production enviornment. I log my clientside errors with Ajax and other methods to the server so I can spot and fix errors I would normally never see. With the amount of clientside code people are implementing these days, it is probably well worth it.

So with that said, I posted my full description of my talk on the conference site: http://theajaxexperience.com/show_session_view.jsp?sessionId=1419&showId=58.
Hope to see you there!

Eric Pascarello
Coauthor of Ajax In Action
Moderator of HTML/JavaScript at www.JavaRanch.com
Author of: JavaScript: Your Visual Blueprint for Dynamic Web Pages