Can there be any reason not to possess a web page retrieve it's primary content quickly?
For instance, I've got a page which has a header along with a footer, and in the center of this site is definitely an empty div. Whenever you click among the buttons within the header, an http GET is performed behind the curtain and also the .innerHTML() from the empty div is changed using the result.
I can not think about any reason this can be an awful idea, however i can't appear to locate any pages available which do it? Please advise!
It's known, but you will find issues.
Additionally, it may adversely impact handicapped customers which are using assistive technology like a screen readers.
It will make it tougher for the browser to effectively cache your static content, slowing down lower the browsing experience.
It will make it tougher for search engines like google to index your articles.
It may cause the rear and forward buttons to prevent working unless of course to consider special making them work.
It is also fairly annoying to debug problems, although definitely not impossible if you are using something for example Firebug.
I wouldn't apply it static content (an ordinary web site) but it is certainly an acceptable method for content that's dynamically up-to-date anyway.
Without work from you it kills the rear and forward history buttons, also it causes it to be hard to connect to the web pages each button loads. You'd need to implement some kind of URL altering mechanism, for instance by encoding the final clicked on page within the URL's hash (e.g. whenever you click a control button you redirect to
#page-2 or whatever).
Two factors: Seo (Search engine optimization) and bookmarks.
It is possible to direct Hyperlink to access your header links? If that's the case, you are (almost) fine. For instance, the next code is both Search engine optimization friendly and populates your page as you wish:
<a href="seoFriendlyLink.html" onclick="populateOnTheFly() return false">Header Link</a>
Where have you read it's a bad idea? It purely is dependent on needs whether content is going to be populated on-the-fly. Generally, however, this content is loaded together with the page this is not on-the-fly but when you need your articles on-the-fly, it should not be an awful idea.
I cant think about a poor reason behind this either (apart from possibly Search engine optimization), one factor that will most likely be advisable would be to load the information only one time. ie
This will keep your server load lower therefore the divs submissions are only loaded once.
This really is pretty standard behavior in ajax enabled sites.
Bear in mind however that extra effort is going to be required to:
- make sure the back button works
- connect to (and bookmark) specific content