Just wondering whether dynamically built HTML layout is fine from SEO perspectives? So let's assume e-commerce engine and its most popular page – products catalog. So 90% of the page is built using AJAX and MVVM library knockoutjs which builds HTML on the fly on the client side. So how search bots would parse such content? Is it fine indexed and would be such effective as server-side built HTML pages from the SEO perspectives?
SEO – Is Dynamic HTML Layout Good for SEO?
ajaxhtmlsearch-engineseoweb-development
Related Solutions
Some general rules I follow:
General
- Indents are 4 spaces.
- Indent new levels
- Comments are < ~80 chars from the indent level. If I'm in two levels (8 spaces) that means the cursor stop will be around 88 characters.
- Use multi-line comments. I prefer the look, however this is a subjective point.
- Comment now rather then later when you have no idea what's going on.
- Allman style braces. It's cleaner and is more readable. Subjective.
JavaScript
- Use a library. jQuery in particular is very good. It eliminates all cross browser headaches.
- Understand that ID's are for particular elements, classes are for styles. ID's shouldn't be used more then once per page and they will have particular hooks attached to them. Use classes for things like navigation.
- Out source into methods. It's tempting to put all the code into the
bind
call, however putting it in it's own function will increase the flexibility of your code. - Use functions instead of evals. That means
setTimeout(function(){ /* Do something */ }, 1000);
instead ofsetTimeout('doSomething', 1000);
- Use local variables with
var
.
HTML
- Semantic markup. Use appropriate tags. Don't put
<br />
's in there to add space, adjust margins and CSS rules. - All tags are lowercase.
- All tags should end with a closing tag or be self closing.
- Make use of classes for layout that is similar. Have a couple of predefined classes like
hide
,clear
,error
, etc. - Everything (scripts included) should go in
<head>
. Worry about optimizing (moving stuff around) when it presents a problem. - External stylesheets and JavaScript source is a must unless it is page specific.
PHP
- Frameworks are good, I recommend CodeIgniter.
- If you don't want to use a framework, try to use the latest version of PHP possible. (That means 5.3).
- Use
includes
to your advantage. - Clear injections or use prepared statements.
Perform if checks on preconceived fail-secure values.
$logged_in = false; if(check_user($user)) { $logged_in = true; $user = load_user($_SESSION); }
- Know the difference between single and double quotes. Use single quotes when possible.
- Don't echo HTML.
Your Question is going to return some very opinion based answers. So I am trying to answer as neutral as possible regarding which Framework or option to use.
I think every thing you pointed out is fairly modern as are all your listed technologies. jQuery and AngularJs aren't that old I guess.
Also I believe that you have already answered your own question. Let me explain my utterrance in detail :
Out of 3 mentioned practises you don't like 2, so only one mix really remains.
I personally find the mix #1 and #2 ugly
Why not just go with what you are comfortable with for now instead of relying on the opinion of other people. You seem to know what you are doing and have an open mind to new developments in your field so why worry about what other people think for now. Your question helped me discover something new. Thx for that. Hope that helped.
Originally a comment was just too long for it to be one.
Best Answer
Here are some resources for you to peruse. In short:
If you have dynamic generation schemes embedded in your javascript (javascript menus for example), provide a static sitemap to the embedded content.
Google can crawl Ajax links, if you take certain steps.
https://developers.google.com/webmasters/ajax-crawling/docs/getting-started
http://www.webbizideas.com/images/SEO-Friendly-Design-Guidelines.pdf