![]() |
A stupid little php/java trick
That can produce some cool results.
I was recently working on a very large scale database project. The database involved contains several tables wtih a million to 2 million records in it. The problem I was trying to address was the page loading when it was trying to return counts that went across the entire database. I didn't want the usual solution of putting up a message and doing a redirect to the results page because I didn't want to have to tell folks not to press the button again or any of that stuff. So, I invented. After thinking about it for a while I came up with what is a simple method that produces a very cool look. As I am writing the page (this is a dynamic write from the server) I produce a division and name it something and place a message in the division. This is all inside a table structure and I have server buffering turned off so that I am sending to the browser as I go. ie: <table><tr><td> <div name="countssection" id="countssection">Please wait while I compute the counts</div> </td></tr></table> Once the browser gets the close table tag, it shows the message. After I write the message I actually go and compute the counts, once the counts are computed I write a line of script to the browser, ie: <script>countssection.innerHTML='the computed count for the query is 50000';</script> When the browser receives this line, it replaces the innerhtml value of the division with the new message. This achieves a very cool look to the page without having to reload the entire page. This method also is an easy way to create a rotating banner script or a dynamic section for a web page in a quick and easy manner...... A proof of concept on it is at http://www.bntnews.com/countit.php and the source code for that is at http://www.bntnews.com/countit.phps |
Re: A stupid little php/java trick
Sabby's been looking for that pic ;)
|
Re: A stupid little php/java trick
Quote:
|
| All times are GMT -4. The time now is 12:31 AM.. |
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright Evil Empire Inc. 2006-2022