View Full Version : dynamically generating html vs using html scaffolding?
faisalv
13 Jun 2008, 12:05 PM
Are there any guidelines people use that help them decide when it is
better to dynamically generate all html elements using Ext (auto-render)
versus actually writing some html and using it as scaffolding (renderTo)?
Is it purely a function of whether you want your page to demonstrate some markup in the absence of javascript? Or are there any other advantages to writing html (i.e. does it help with the layouts?)
Are there any other pros and cons to either approach?
Thanks!
Faisal Vali
devnull
16 Jun 2008, 10:10 AM
I find that each new generation of my webapps have less and less hand edited html in them, with the most recent ones having nothing but a body tag and the Ext includes. The code just becomes so much more managable when its all in one place (just javascript vs javascript and html), and there are fewer layout and rendering issues.
Of course these are truly webapps too, which depend fully on javascript to work in the first place so there would be no value to having a static html alternate version.
deanoj
16 Jun 2008, 11:01 AM
Does your site need to be search engine friendly? If not (like my app) I use a single div to contain all of my Ext components.
Some of the content is still in HTML, such as the page title - as this is server generated. I just make these elemets hidden using CSS and 'lift' them off the HTML into the desired position.
Deano
DigitalSkyline
17 Jun 2008, 9:20 AM
I think it boils down to ... does your app require JavaScript... if so... by all means dynamically generating HTML is the way to go.
There are many advocates for graceful degradation, but in the case of an Ext UI it would be easier to create 2 separate applications than it is to try and support 1 app that degrades to basic HTML.
deanoj
17 Jun 2008, 10:55 AM
Another case I will offer is in the case of a printable product advert page.
What made sense to us was to produce the static html that acted a printable page, then 'lift' off the required data and use it tab panels for example for web viewing....
I'm sure there are many cases where one appraoch may be more favourable depending on cirumstances.
Dean
Lobos
17 Jun 2008, 2:46 PM
Another thing to take into account is the fact that Ext looks after browser incompatibilities for you. As soon as you start adding your own html you will start to have to maintain it - and believe me this is a real pisser, you need to test it in all browsers to make sure it look the same and you will have to continue to do this in each future version.
If you are worried about search engines, tip: that they don't care how your site looks ;)
devnull
18 Jun 2008, 7:15 AM
search engines do not execute javascript though, and the valid point being put forth is that apps like mine dont contain ANY content as html, rather fetch it using ajax. which of course the search engine spiders are unable to do. they may not care how it looks, but they do need to be able to spider the content :)
Lobos
18 Jun 2008, 10:35 AM
search engines do not execute javascript though, and the valid point being put forth is that apps like mine dont contain ANY content as html, rather fetch it using ajax. which of course the search engine spiders are unable to do. they may not care how it looks, but they do need to be able to spider the content :)
Thats where you have you server supply the raw content, bascially you need to detect when it is a search engine and then publish to suit. I am asuming your site has content as well as ui elements? if so just give the text to the search engine, all mapped out with nice seo friendly links for it to follow. It is also a good opportuinty to create a nice layout for accessiblity as well, a real minimilist approach :0
devnull
18 Jun 2008, 11:54 AM
yeah there are a number of ways to deal with the issue, but fortunately I havent had to since all my apps so far have been internal intranet apps ;)
faisalv
15 Jul 2008, 9:12 AM
Thank You All :)
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.