View Full Version : Ajax Tabs - What is the Search Engine Result for Ajax loaded 'external' pages

08-09-2012, 03:02 AM
1) Script Title: Ajax Tabs

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm

3) Describe problem:
I plan to use your Ajax Tab script on many pages of my site, but, before I do, could you please answer the following stupid(?) questions.

I know external pages that will be loaded with ajax into my tabs will be search engine friendly, but...

a) When a google search is conducted is that external page referenced as the 'result'? That is will the user be directed to my external page that has no menu, no css etc. I ask as the majority of my important 'key word, headings etc' content will be on external ajax loaded pages.

b) If the answer to a) is yes - what is the best way to somehow re-direct the user to the right page?

b) What is best practice coding for these external pages? Should I bother to include <head> <body> tags with Doctype info etc?

Thank you in advance. I love the script and have got it working really well, which is an achievement given that I am a total newbie to coding and clearly have much to learn!

08-09-2012, 04:21 AM
SEO is good as they are seen as normal links. To redirect to the 'top' page would require additional code. I believe this has been worked out for this script or similar. I just can't find it right at the moment.

08-09-2012, 04:31 AM
Thank you very much for your response John.

As you are looking for the code to redirect people to the 'top' page I take it that my answer to question a) is YES people will be given the link to the external page.

Hmmm. If this is indeed the case I would certainly appreciate a link to the missing redirect code if you would be so kind. Also could you answer part c) of my question - should I put in CSS etc in a <head> tag for it? Even if it's just for those browsers who have JavaScript turned off?

08-09-2012, 04:56 AM
For c I would be inclined to have an external stylesheet. It would be best if it were the same one used by the 'top' page. And/or it could have selectors that would be overridden by the styles on the 'top' page. Like on the top page, everything imported will be a child of the container id. That could be used to override whatever style (other than inline style) is on the external pages. I like this approach because if you have styles on the external page, some browsers might import them.

<noscript> tags could be used to give various notices as well as to set non-javascript styles.

As for code to load the 'top' page a javascript redirect on the external page could be used:

if(location.href.indexOf('thispage.htm') > -1){

Where thispage.htm would be the name of the external page, and toppage.htm would be the path and filename to the 'top' page, and tabsname would be the id of the tab group and index would be the 0 based index of the tab you want loaded.



for the second tab in the tabsname group.



for more info on exactly how that part works.

08-09-2012, 11:33 AM
Hi again,

I applied the redirect and it works (thank you) plus I added some minimalist style to my external pages (still lack menu, header and footer of course). I have a few more questions....

a) I use Google Analytics and was going to employ Google Adwords. Because my main content is in ajax loaded external pages I guess I will need to use the url belonging to these external pages in order to get high click through rate... Is this correct?

b) If YES is the answer above then I will be constantly redirecting search engine users AND Adword clickers (using your lovely JavaScript code). Will this ultimately be using up more of my allotted bandwidth? Or, is the external page not actually loaded (with the redirect in place) meaning my bandwidth will be unaffected?? Note that I will be including the Google Analytics script (altered so it works immediately instead of with the usual delay) on these external pages too (before the redirect script).

c) Lastly I've read a little about how redirects are often used as a means of cheating the Googlebot (cloaking or something). I will be using the redirect legitimately, but, is there a chance that Google may think otherwise??

It's a pity that IE does not support pushstate otherwise I would be trying to implement that! Will Dynamic Drive include Ajax Tabs with pushstate and a fix for old browsers etc sometime soon??? I know I ask a lot, but, I have searched and cannot find answers elsewhere. I really appreciate your help.


08-09-2012, 12:10 PM
I really just don't know the answer to any of those questions.

Generally a search engine ignores javascript though, and I'm pretty sure analytics would ignore any but its own.

I'm unfamiliar with what you mean by "pushstate", a quick Google shows that it's for manipulating the history stack. The code I gave you already does that and is supported by IE. It manipulates the stack by taking the external page out of the stack. So, if the person gets to your 'top' page from Google after clicking on a link on Google for one of your external pages, and then hits their back button, they will go back to the page on Google that sent them there.

I think that's the ideal behavior here. But if you have a different one in mind that could probably be arranged.

But if you mean putting the tabs on the stack, that would probably be a bad idea. Why would you want to do that?

In any case the history stack is something that few users really use all that much, and when they do - it doesn't always perform as expected/desired. If they still use it a lot after discovering that fact, they're used to it not always being the solution to their navigational needs.

From a design point of view, I pretty much ignore the ramifications of what the back and forward buttons might do for a given page because of some script or whatever. It's just not that important. And these buttons have become more sophisticated. Savvy users generally can still get what they want or need from them.

I seriously doubt analytics or search engines in general look at the stack much, if at all. And if they do, it probably looks very different than it would to the average user's browser. Probably looks like it would to a browser with javascript turned off.

But, as I say - I really don't know. The above are just my thoughts on the matter.