Monday, July 31, 2006
Saturday, July 15, 2006
In an administrative interface of my Photo Gallery I'm using XMLHttpRequest to send all the information about picture being uploaded to a server and check its validity. (I used synchronous mode because at the time I programmed it all the AJAX heap wasn't there yet). I wanted to upload files with the help of XMLHttpRequest without page reloading, but I couldn't find a way to do that. There were some proprietary IE solutions and proprietary Mozilla solutions, but no common one. To upload file, HTML form must set ENCTYPE="multipart/form-data" (a default value is "application/x-www-form-urlencoded") and it seems that XMLHttpRequest cannot do that.
The solution I found was to check everything and send a data to server using XMLHttpRequest without page reloading, then to upload a picture using conventional FORM POST operation inside an IFRAME.
It looks like that there is nothing new that and this Indian guy uses similar approach with his "AJAX File Uploader" class.
Although.... let's investigate all results of corresponding Google search.
Friday, July 14, 2006
I created a new sub domain for learning and testing new [Web] technologies. I will add some examples of using various Web-related technologies there.
I'm starting to educate myself with an unusual strength :) I fell behind once again.
AJAX - it's a pleasure! It's a coming way of making really interactive Web applications which communicate with a server without page reloading. There are plenty of books on this issue (and I bought almost all of them) but one really stands apart: Ajax Design Patterns by Michael Mahemoff
His site is http://ajaxpatterns.org/.
PHP. Version 5 is a full-fledged OOP language with a lot of convenient and powerful libraries developed for it. You normally can do anything you can do in ASP.NET, for example, but in a much easier and more flexible way. I was surprised when I started to work with PHP on how much better, bigger, and more convenient is its standard library and common user-developed libraries than ones used in ASP. Open Source rules!
I'm going to learn and pass Zend PHP Certification http://www.zend.com/store/zend_php_certification
It's a cool thing, if you learn it with an excellent Head First Design Patterns (thank you, Andrew, for pointing me to it) written by by Elisabeth Freeman and Eric Freeman
MySQL 5.1 and PostgreSQL - I need to jump into that.
I still need to get heavily involved into ASP.NET and C# development. While I like C#, I think that ASP.NET approach suffers greatly from usual Microsoft's design flaw: it's too big, it's too predefined, so when you develop a real application you spend more time on finding workarounds for built-in events and other features which work the way they were designed, but not the way your application's business logic dictates.
Thursday, July 06, 2006
Wednesday, July 05, 2006
I think it's a nice user-friendly feature. It's too often when users of my ASP applications enter a bunch of data to a form, then went somewhere, return and click on a "Submit" button just to realize that session was already expired and all data entered was lost.
Question: how to implement that feature (wit ASP or PHP back-ends)?
ASP provides Session_OnEnd event (PHP does not), but it gives no help: I don't think you can refresh a session at the time this event is fired, and you cannot interact with user from inside this event handler.
But what if there are more than one browser window, frame, or iframe open for this site? Especially for multiple windows we need a way for server to initiate counter reset on all client windows when one of them is refreshed. (By the way, it isn't implemented correctly on my bank's website). We could make one more XMLHttpRequest to a server just before displaying a coming expiration warning. It will ask a server for actual expiration time and reset this window's timer as necessary. But for server to know expiration time it must be reset during each page server script running and saved ... in a session variable.
Another solution which comes to mind would be to use server-push technology to reset all necessary client timers. There are some interesting news about it there.
What do you think about all that?