in reply to Running CGI Scripts without redirecting the browser
As others have mentioned there's not really a way to do exactly what you are trying to accomplish, however you can fake it by outputting your CGI to hidden frames and mixing in Javascript.
That said, its usually more trouble than its worth IMHO. When you fake it then you have a whole new set of problems deciding what to do with people who haven't enabled Javascript or people in say, lynx, that aren't going to have frames at all, not to mention all the inconsistancies in Javascript across browsers.
I've been building web apps for a long time and I've discovered that customers and designers and other programmers are much much happier when you follow the KISS method. Keeping things simple benefits everyone and makes things easier to maintain down the line.
There are three reasons I've found that programmers do what you do, the first is somewhat valid. They feel that by loading only portions saves on load time. This is only true if your entire page is covered in text that doesn't change with the CGI script. The static images get cached anyway so a full reload of the page isn't going to help. If the output of your CGI provides new images, well you still have to load them either way.
The second reason also has validity, alot of people want to do things this way to keep a look consistant without coding alot of HTML into the CGI script. This can be accomplished much easier by using a template system. Yes you will still be reloading static elements of the page but see point one above. My templating system of choice is HTML::Template
And finally the most common is the gee-whiz factor, trying to make a web-app behave like a local app. I must say that in almost every case that I've used something like this its been confusing to use and/or broken because of browser inconsistancies, pop up blockers, not using IE, etc ... So yeah it might look cool on your browser with your settings but it might be a nightmare for your users.
So i would suggest that you evaluate why you want this functionality in the first place, because the simpler you can make it now, the less headache it will be for everyone in the future.
Hope that helps
Chris
|
|---|