| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jun 2004
Location: Tacoma, WA
Posts: 2
|
updating a div from database
I have read some threads on this topic, but am not sufficiently clear on the concept to implement what I want to do... I have a static page with a hidden <div> that is made visible via a javascript link. The <div> is populated with info from a MySQL database. The div contains a form that is used to update the database. The way it currently works is that the form reloads the entire page, including the div. It seems to me that it would be more efficient to have the div updated with new data WITHOUT reloading the entire page. So, a double-level question: 1. Am I right that reloading the div alone is preferable to reloading the entire page? 2. If 'yes' to #1, how does one do that? innerHTML? Even if there is a fair amount of information? I'm not sure how to use innerHTML when generating an unknown amount of information being pulled from a database. Thanks.... |
|
|
|
|
|
#2 (permalink) |
|
Registered User
Join Date: Mar 2004
Location: Derby, UK
Posts: 24
|
What you are talkibng about is essentially the concept of 'frames' where the browser viewport is split between multiple sections each of which is a seperate web page. Frames became quite common for a while because they allowed greater efficiency as you say, by not requiring full page reloads, however they raise all sorts of other issues and are generally avoided by smart developers now. However for what you want it would be possible to use an iframe which is like a frame embedded within a page. These are not quite as bad as full on framesets and would do what you want. That said, it is only really worth doing if the part of the page that you wont be reloading is large enough to cause performance issues, otherwise I would be tempted to stick with a single, frame free, page personally. |
|
![]() |