Categories: Crawling, indexing & ranking :

best way to include static content in dynamic pages?

Showing 1-40 of 40 messages
best way to include static content in dynamic pages? loupiote 6/19/10 5:11 PM
i have pages that contain some dynamic content.

i am able to generate a "static" version of this dynamic content and include it in my html pages so that this content gets indexed by the search engines. this "static" content is invisible from the normal user, and replaced by an identical "dynamic" content - unless the user turns off javascript in their browser, of course.

but what is the best way to include this "static" content?


2010-06-20
solution 1)
<noscript>
... static content ...
</noscript>

solution 2)
<div class="invisible">
... static content ...
</div>

and define the CSS for class="invisible" with "display:none"

which of those will work better?
will anything inside a  
<noscript>...</noscript> be treated with less weight than normal content?

2010-06-20
solution 3) [probably the best]

include the static comment in a block that will be swapped by the dynamic version.
Re: best way to include static content in dynamic pages? RainboRick 6/19/10 5:44 PM
Generally speaking, it is a violation of the guidelines of all of the major search engines to include content in your pages that is only visible to the search engines.  Using <noscript> would mitigate that issue, but I wouldn't count on the search engines paying very much attention to that content.  You definitely do not want to use CSS to make content invisible, unless you provide a clear mechanism for the user to make it visible.  Overall, this sort of thing falls into the category of "not worth the effort".  If you want a page to perform well for particular search terms, use those terms in prominent locations on that page.  Any other approach is almost sure to be a waste of time.  Good luck!

Re: best way to include static content in dynamic pages? webado 6/19/10 5:55 PM
What do you mean by  identical "dynamic" content  ?
Re: best way to include static content in dynamic pages? loupiote 6/19/10 6:08 PM
Generally speaking, it is a violation of the guidelines of all of the major search engines to include content in your pages that is only visible to the search engines.

i know, of course, this would be "cloaking". but this is not the case here. the contents visible to the viewer contains the same text, but the text in question is in DOM elements that are normally dynamically generated.

there is an example on this page:

look for the text "An amzing photo. Deserves to become one of the iconic images of the early 21st century. (Yes, it's that good.)" toward the bottom of the page.

the (moderated) comment made by a user is in a dynamic DOM element generated by js-kit. but i want those to be seen in the static version of the page (not just search engine, but any browser with no javascript, too - i.e. it's not cloaking based on user-agent)..

so if you look at this page with no javascript, or if you look at the source, you will still see this text which is normally in a dynamic elemeny if you have javascript.


Re: best way to include static content in dynamic pages? loupiote 6/19/10 6:23 PM
but I wouldn't count on the search engines paying very much attention to that content.

so any content that is in a <noscript> section is virtually ignored by search engines?

so when you have ajax-based sites with lots of dynamic content (for which you can provide the same content in static form, like here), what is the preferred / recommended way to present it so that it gets indexed?
Re: best way to include static content in dynamic pages? webado 6/19/10 6:26 PM
>>so any content that is in a <noscript> section is virtually ignored by search engines
 
Not at all. On the contrary. But its justification has to be that it is equivalent to whatever is otherwise visible in javascript.
 
So in case you serve something drastically different in noscript than what yo have in a script, it's possible either robots will discover it, or competitors who are only looking for an opportunity to sink your site might.
 
 
I didn't see whatever your page was supposed to have with or without javascript. It looks like the stylesheet is shot or something. Maybe because you have content at the top before the doctype.
 
Re: best way to include static content in dynamic pages? loupiote 6/19/10 6:30 PM
ouch - thanks for the heads-up... yes, there is a comment before the doc-type.... i didn't realize html comments were not allowed before the doc-type, i'll have to fix that :(

>>so any content that is in a <noscript> section is virtually ignored by search engines
 
Not at all. On the contrary. But its justification has to be that it is equivalent to whatever is otherwise visible in javascript.

good

So in case you serve something drastically different in noscript than what yo have in a script, it's possible either robots will discover it, or competitors who are only looking for an opportunity to sink your site might.

so since i serve the exact same content, there should be no problem there. thanks!

i'll fix that page so that you can see it...

no problem seeing it with chrome - what browser are you using that trips on this spurious comment line at the top of the file?

Re: best way to include static content in dynamic pages? webado 6/19/10 6:34 PM
>. didn't realize html comments were not allowed before the doc-type,
 
It's not that they are not allowed, but anything before the doctype makes the browser render the page in quirks mode, and then parts of the stylesheet largely no longer work. 
 
 
 
Re: best way to include static content in dynamic pages? webado 6/19/10 6:37 PM
IE7.
 
Quirks mode is different for every browser.
 
I see what you wanted to have in Chrome. One heck of a busy page.
 
Well fix your markup and your css (http://jigsaw.w3.org/css-validator/validator?profile=css2&warning=2&uri=http%3A%2F%2Fwww.loupiote.com%2Fphotos%2F3004192959.shtml ) so it's all valid and then it will work in all browsers more or less the same way.
Re: best way to include static content in dynamic pages? loupiote 6/19/10 6:39 PM
ewww, yes, this is fixed now on this page. it was a recent change and i forgot to pass that in the checker.

doc-type is duplicated - shouldn't be a problem, and it will be fixed once many pages have been regenerated, in a little while.
Re: best way to include static content in dynamic pages? webado 6/19/10 6:42 PM
You also have a javascript error reproted as being line 890 - object expected. I've not figured out just what it is.
 
 
Re: best way to include static content in dynamic pages? loupiote 6/19/10 6:44 PM
ok, i'll look into that javascript error, thanks.

but at least you should be able to see that static / dynamic text i mentioned...
Re: best way to include static content in dynamic pages? webado 6/19/10 6:45 PM
Still the same.
Re: best way to include static content in dynamic pages? loupiote 6/19/10 6:53 PM
i can see it with IE7...

so basically, what i am doing is ok, i.e. have the exact same dynamic content inside a <noscript> section.

so you just don't agree with  RainboRick who says that "any content that is in a <noscript> section is virtually ignored by search engines".
Re: best way to include static content in dynamic pages? webado 6/19/10 7:20 PM
 
I neither agree nor disagree. I want to understand what exactly you are doing and asking.
 
I am seing a basically unstyled page in IE7.
 
I don't understand which is your dynamic content and which is the static content. Looks all the same.
 
Re: best way to include static content in dynamic pages? loupiote 6/19/10 7:41 PM
i see a slyled page with IE7, FF and Chrome - maybe a cache issue?

if you have javascript enabled, under the image you should have a js-kit block that allows users to enter a comment, and one comment under that box.  this is all in ajax-generated DOM elements.

if you disable javascript, you should see the comment (formatted differently) as static text.
Re: best way to include static content in dynamic pages? loupiote 6/19/10 7:41 PM
yes, they look the same, indeed, that's the idea.  if they looked different, it would be like, hmmm, cloaking.
Re: best way to include static content in dynamic pages? webado 6/19/10 7:45 PM
I've been refreshing no end, both with F5 and CTRL F5.
 
Anyway, doesn't matter.
 
Doesn't sound like anything bad, but unless I see the dynamic thing, I cannot  imagine why you'd have both.
 
 
Re: best way to include static content in dynamic pages? loupiote 6/19/10 7:46 PM
ohhh i see, looks like a problem on the page i indicated.


there should be a comment on it.  in both dynamic and static form...
Re: best way to include static content in dynamic pages? webado 6/19/10 7:49 PM
Same issue.
Re: best way to include static content in dynamic pages? loupiote 6/19/10 7:52 PM
i tested with IE7, FF and Chrome, and i see the comment.

but sometimes js-kit.com might not be serving the comments, based on your location, or maybe your server blocks js-kit.com etc, in which case you will see a "Loading..." under "Your Comments". i cannot control that.

but even if that's the case, you should see a div called 
<div id="jskit-feed">

with the static version of the comments that our server fetches from jskit.

Re: best way to include static content in dynamic pages? loupiote 6/19/10 7:53 PM
Same issue... you mean that you don't see the js-kit comment box in which you can input some text, under "Your Comments"?
Re: best way to include static content in dynamic pages? loupiote 6/19/10 7:55 PM
<noscript><div id="jskit-feed">... </div></noscript>

(so only visible if javascript is disabled)
Re: best way to include static content in dynamic pages? webado 6/19/10 8:02 PM
OK I saw it FF with and without JS. I think it's OK to sue noscript that way. FWIW.
 
You really really have to fix your markup and css, you have a really bad page in IE7. No idea how you happen to see it OK. Are you using IE8 with compatibility or whatever it's called? Obviously it's not the same as true IE7.
 
In IE7 I am also not seeing any of your Adsense ads.
 
I am not aware of blocking anything except a few trashy sites - and they are blocked in the hosts file so regardless of browser they'd be blocked.
 
 
 
 
Re: best way to include static content in dynamic pages? loupiote 6/19/10 8:07 PM
i use IE7, and i do see the ads. and the javascript debugger doesn't trip on any error.  strange. i use "DebugBar" on IE7.

i'm on windows XP SP3 with all security updates installed.

also tested with FF, the javascript debugger does not trip on any errors (there are some "normal" exceptions inside try/catch blocks, those are not errors, just caught exceptions).

no problems with Chrome either.

I'll try to find what causes the issues that you see.  but apparently given the adsense statistics, 99% of the people do see our ads, so i don't think that what you see with IE7 is what most people see. strange!
Re: best way to include static content in dynamic pages? loupiote 6/19/10 8:08 PM
OK I saw it FF with and without JS. I think it's OK to sue noscript that way. FWIW.

ok, good. thanks.
Re: best way to include static content in dynamic pages? webado 6/19/10 8:16 PM
I'm on a Windows Vista with whatever latest updated and patches have come through (it's all automatic - I've  only disabled the installation of IE8 since it freezes my pc).
 
No visible problems in Chrome, but I don't have developer tools there - can't turn off js for instance.
 
Probably my IE7 is completely in tune with my expectations: it fails to render when there are so many errors.
 
Just kidding but it's really shows broken to me.
 
 
Re: best way to include static content in dynamic pages? loupiote 6/19/10 8:22 PM
thanks for the info, webado, i'll try to find a way to figure out what makes IE7 trip on vista.

there should not be that many errors on my pages, i pass them quite often in the verifier, and most errors that are left are those that are somehow hard to get rid off but do not seem "fatal".

i usually use chrome most of the times (it's much faster than all other browsers), and FF next.
Re: best way to include static content in dynamic pages? webado 6/19/10 8:24 PM
56 errors
 
54 errors and 285 warnings
 
You got some work to do.
Re: best way to include static content in dynamic pages? loupiote 6/19/10 8:30 PM
ps: i checked with IE7 and IE8 with browsershots and netrenderer, and they all show the ads and no obvious styling error.

i think your IE7 is broken :)
Re: best way to include static content in dynamic pages? loupiote 6/19/10 8:32 PM
if you look at the errors, most (if not all) of them are not real errors.

e.g. Line 28, Column 34: there is no attribute "value"
<meta property="fb:app_id" value="139733686125">
etc...
Re: best way to include static content in dynamic pages? webado 6/19/10 8:32 PM
I use IE7 for all my normal browsing (js turned off for suspicious sites) and also test my own pages with Chrome, FF, Safari and Opera.
 
I can test in IE8 when I have a chance using my son's laptop.
 
Chrome is fast alright but somehow I'm not comfy with it. I'm missing my playthings.
 
 
 
 
Re: best way to include static content in dynamic pages? webado 6/19/10 8:33 PM
Doesn't matter what most of the errors are - they ARE.
Re: best way to include static content in dynamic pages? loupiote 6/19/10 8:33 PM
i'm refreshing the pages and the "no doctype" error will disapear in a few minutes. it does not seem to create havoc anyway.
Re: best way to include static content in dynamic pages? loupiote 6/19/10 8:36 PM
well, sorry but if facebook integration requires me to have
<meta property="fb:app_id" value="139733686125">

i will have that, even if it is detected as not fully compliant with some version of the standard.

the way html / xml are defined, if something is not compliant in an element, it does not normally impact the parsing of all the rest of the document.  it was designed this way, to be  forward compatible with future extensions of the syntax , tags and attributes.
Re: best way to include static content in dynamic pages? loupiote 6/19/10 9:29 PM
@RainboRick

Generally speaking, it is a violation of the guidelines of all of the major search engines to include content in your pages that is only visible to the search engines.  Using <noscript> would mitigate that issue, but I wouldn't count on the search engines paying very much attention to that content.  You definitely do not want to use CSS to make content invisible, unless you provide a clear mechanism for the user to make it visible.

i think that technically, the two methods are equivalent, i.e. they do not feed anything special to search engine compared to user. they show the same text to search engine and to browsers that do not have javascript enable.

the difference is that if javascript is enabled, in one case the browser would ignore the static text that is in a <noscript> block, in the other case, the browser would (dynamically)  hide the static text that is a duplication of the dynamic text.

i don't think that hiding text duplicated between a static part of the page and some dynamic DOM's is against the search-engine guidelines, as long as the text is the same (i.e. this is not done for manipulation, but just to cause the search engines - and non-dynamic browsers - to see the basically same content as viewers looking at the page with a javascript-enabled browser.

a lot of sites are very dynamic, with lots of ajax content. there has to be some guidelines regarding the preferred way for those sites to include static version of their content in their html pages.

do you know if google has actual published guidelines that would apply to the practical exemple i described?
Re: best way to include static content in dynamic pages? JohnMu 6/20/10 2:12 PM
Hi loupiote

My preference would be to use JavaScript to gracefully enhance the static content on your pages. I don't know how much of that would be possible with your choice of commenting system, but I could imagine an optimal situation where the comments are shown with normal static content, and the "dynamic" elements of the commenting system (eg login, comment-box, etc) are created with JavaScript. By doing it that way, you could avoid having to worry about noscript elements, and all of that. Another possibility could be to display the content normally and to use JavaScript to swap out the block with the dynamic version, when JavaScript is available. This would allow you to use server-side caching to keep the speed up, while still making sure that all of the visible content is up to date (through the JavaScript from the commenting system), it would also allow search engines to see exactly what users without JavaScript would see.

Failing that, I imagine the use of a noscript element in the way you are using it might be a fairly safe compromise. One of the problems with noscript is - as others have mentioned - that it's been abused quite a bit by spammers, so search engines might treat it with some suspicion. So if this is really important content, then I wouldn't rely on all search engines treating your noscript elements in the same way as normal, visible, static content on your pages. If this is "just" for comments, then that might be worth considering regardless, especially if the alternatives are much more complicated.

Hope it helps!
John

PS How is the commenting setup working for you?
Re: best way to include static content in dynamic pages? loupiote 6/20/10 2:29 PM
@JohnMu

thanks for your advice.

i'll try to include the static comment in a block that will be swapped by the dynamic version, it looks like a better solution.

the js-kit commenting tools work pretty well, i've been using them for a long time, i was one of their early users.
Re: best way to include static content in dynamic pages? dwing_slp 6/25/10 11:30 PM
very informative thread. the following site www.naturesbasin.com, has a left nav that is being displayed using javascript. however, there is also css code to decide whether to display the left nav or not. the css code looks as follows:
.left_nav55 { display:block !Important; }
.sam { width:730px !Important;  }
i am just wondering if it violates any google guidelines and will it cause seo issues. thank you for your help.
Re: best way to include static content in dynamic pages? loupiote 6/25/10 11:36 PM
by the way, i am now doing what JohnMu suggested, i.e. i include the static content in a block that will be swapped by the dynamic version (that has essentially the same content). i think it's a good solution.

More topics »