Keeping part of a page from reloading if it is the same across multiple pages

iansilv

Limp Gawd
Joined
Jun 10, 2004
Messages
335
Hi- Please forgive me if my question is stupid, but I can't seem to wrap my head around a solution. I am not a coder or a programer, I am designing a software solution. My question is this- if I have, say 9 pages for a website application, and the top portion of every single page is exactly the same for all of them, is it possible to set that section to not reload when a new page is clicked? How would this work? Thank you, and again, I apologize in advance for the "noob" question.
 
well, traditionally one might use frames for that, thought the content of the frame would be fixed at the top, as opposed to scrolling with the rest of the page. not that i'd recommend frames myself anyway

another option would be to load a content div's content with ajax but that would require a certain knowledge of javascript/programming knowledge and to achieve
 
Hi- Please forgive me if my question is stupid, but I can't seem to wrap my head around a solution. I am not a coder or a programer, I am designing a software solution. My question is this- if I have, say 9 pages for a website application, and the top portion of every single page is exactly the same for all of them, is it possible to set that section to not reload when a new page is clicked? How would this work? Thank you, and again, I apologize in advance for the "noob" question.
Is there a business reason or some other purpose behind wanting to preserve the top content without refresh?

tim_m gave two viable solutions, but I'm left wondering if there's a difference between what you're really trying to achieve versus how you've worded the question.
 
What I am trying to achieve is to have the page refresh faster. Ideally, the only thing that would be reloaded on the pages is the data that is displayed- none of the framework, the layout, the colors, etc would reload. I guess if changes are made to the pages then they would have to reload from the server, but if the page did a check each time to see if anything was different that would fix that.

The main business motivation is to have the website behave as much as possible like an application.

What about cache settings? Is there a way to set the site so that local browser cache settings keep everything that does not change?

thank you.
 
What I am trying to achieve is to have the page refresh faster. Ideally, the only thing that would be reloaded on the pages is the data that is displayed- none of the framework, the layout, the colors, etc would reload. I guess if changes are made to the pages then they would have to reload from the server, but if the page did a check each time to see if anything was different that would fix that.

The main business motivation is to have the website behave as much as possible like an application.

What about cache settings? Is there a way to set the site so that local browser cache settings keep everything that does not change?
Understand that there's only so far that a web application can go to acting like a fat-client or client-installed application. But your other points can be summarized into concepts like "maintainable code", "templated page design", and "minimizing server hits". Some further decorations can be done with asynchronous postbacks, CSS, etc. So what you're thinking toward is a good forethought to have.

Though it sounds like your role is (or would be) more of a Business Analyst on this project. The finer details of your concerns and desires can be answered by the technical and project leads after the business rules and some high-level use cases have been discussed.
 
Very cool- thank you for your reply. I am going to research along those lines. Thanks again.
 
+1 for asynchronous postbacks - ala an AJAX approach. It makes it feel more responsive, esp if its a application where the background+header doesn't really need to change
 
I am not a coder or a programer, I am designing a software solution.

Stop. Right. Here.

Do not design software. Present detailed requirements to somebody who understands what they're doing and leave the design up to them. If your objective is for this to load quickly then state that but, unless there's a valid business reason to specify technical decisions, <b>leave them to technical people</b>.
 
Stop. Right. Here.

Do not design software. Present detailed requirements to somebody who understands what they're doing and leave the design up to them. If your objective is for this to load quickly then state that but, unless there's a valid business reason to specify technical decisions, <b>leave them to technical people</b>.

Agreed, the fact that the OP has to ask how to do this technical piece proves you right.
 
In theory I would of course agree with you guys, but perhaps he works at a small company. He did say NINE page web application (pretty small IMO). Maybe there are three employees and he at least wants to get an idea of what he's looking for before he rents a coder or whatever.

Personally, I'd look into doing it with AJAX. Generally, you shouldn't use AJAX just because you can, but if you want the site to act more application like, it is probably your best bet. Whoever ends up making your application, make sure that they keep browser functionality (back button, bookmarks, etc).
 
I suspect he's talking about server-side includes but doesn't quite understand the concept.
 
Last edited:
Unless you have specifically diabled it, all web browsers I am aware of have built in caching. They usually check to see if I page has changed before it will reload stuff from the server.

As for making the coding simpler, you can use simple Javascript includes for anything that is going to be exactly the same on all the pages. Of course Javascript has to be enabled in the browser.

http://webdesign.about.com/od/javascript/ht/htjsincludehtm.htm

The way listed above is a bit mundane as you really don't need a document.write for every single line.

What I do is start out with a document.write at the beginning of the code, copy the code from the html file(which is made first to make sure everything works properly), and then add apostrophies/single quotes to the beginning and end of every line, and then a + to the end of every line.

for example:

document.write(' ' +
'some code here' +
);
having the document write and then two single quotes on the first line makes it easier to read and lets you keep things formatted exactly the same.

This is basically an easy way to make it so if you change something on one page, it will automatically be changed on every other page.

There are some caveats to doing it this was that are listed on this page.

http://www.boutell.com/newfaq/creating/include.html

For my current project that I am working on, it makes more sense to do it via client-side includes so the server will have less of a load on it as well as it not being a publicly accessable app.

And unless you are planning on running this web app on seriously outdated machines, you really aren't going to notice a speed difference even if you have the pages reload what sounds like the header of the page from your description.
 
I think alot (if not all) of the deeper technical explanations and samples are getting out of scope on this thread. The OP is admittedly not a developer, and further questioning has not presented use cases, concrete business rules/needs, and other necessary information to even justify the approaches that were described in the OP's initial post.

The ideal approach for the OP (at this point) is to partner with a development team, to which the OP would fill the role of a business analyst or primary client contact. The OP would then be able to share the application's goals and business needs (preferably without any mention of some technical jargon that's been detailed to this point) with the development lead, so that the technical lead can determine the ideal technical directions for whatever is needed.
 
Back
Top