wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes SEO and AJAX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "SEO and AJAX" Watch "SEO and AJAX" New topic
Author

SEO and AJAX

Frankey James
Ranch Hand

Joined: Sep 27, 2008
Posts: 50
So here's how I have things:
- I have a DIV container that I AJAX by inserting a picture on page load. This data is read from an XML file that contains lots of other picture data(paths, desceriptions, etc).
- A user clicks a next/previous arrow and the next/previous element in the XML file is read and the new picture data is updated/Ajaxed in the DIV container.
- I have many large pictures that relate to a single page

I'm sure we've all seen a sort of image rotator....that uses AJAX so no post pack on the server.

Well, search engines don't like AJAX as they don't run the Javascript, for obvious reasons.



What is the best way to get around this? I'd like to see if someone else has had to deal with this and what they did....


ho, ho, ho
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Develop pages to work with JavaScript disabled?

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

It's a bit of an art, but if you first write the pages to work with script disabled (as Eric said), and then, if script is running, instrument the page to use Ajax.

The whole concept of Unobtrusive JavaScript helps a lot with this.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Frankey James
Ranch Hand

Joined: Sep 27, 2008
Posts: 50
Eric Pascarello wrote:Develop pages to work with JavaScript disabled?

Eric


Are you suggesting using a <noscript/>?

(1) - Say for a page I have 50+ 200kb images. Would this still be a good idea/practice to load all these images when JS is disabled?

(2) - I'll tell you all what I did. I simply extracted all my data into elements and placed them in a TextArea so that the is interpreted as text and not rendered as HTML(picture doesn't load then). I then did a display:none; on the parent container holding these elements. This allows the content to be spidered; however, for human non-JS enabled broswers, users simply won't get any images and won't see the TextArea content....or I could just load a few pics in a <noscript/>. The latter part is what I'm leaning toward now....


The problem with the second way, the way I decided to do it (except the few pics by default), is that it doesn't appear my data within the TextArea is getting spidered. Does google ignore TextArea? I've seen many say no, but it's been a month and normally it only takes a week for my data to get into the indexes. Since this change, other content has made it in google indexes as well. Perhaps I'm being iimpatient? Perhaps google doesn't read TextArea? Perhaps it is somehow interpreting my CSS and seeing the parent container is set to deiplay:none? Perhaps #2 is a bad idea and I should be doing #1?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

Google will not only ignore text-areas, it will most likely ignore any non-displayed areas.

Moreover, they frown severely upon "tricks" and your page rank will plummet if they think you are trying to game the system.
Frankey James
Ranch Hand

Joined: Sep 27, 2008
Posts: 50
Bear Bibeault wrote:Google will not only ignore text-areas, it will most likely ignore any non-displayed areas.

Moreover, they frown severely upon "tricks" and your page rank will plummet if they think you are trying to game the system.


Do you have any specific suggestions for the problem statement (many large pictures) I described? I can simply replace the <textarea> with <noscript>, but human readers with JS disabled would get too many pictures/delay, therefore my use of textarea. The noscript is fine for a spider, however.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

Have a separate page with links to the images?
Frankey James
Ranch Hand

Joined: Sep 27, 2008
Posts: 50
Bear Bibeault wrote:Have a separate page with links to the images?


Actually, this is a good idea. See, at first I didn't have to worry about non-JS users, except SEO issues, because 'everyone has JS enabled'. But this is not the case now. Anyways, talking out loud... I also didn't want to create 'extra' pages. For now I'm going to just wrap the content in a noscript and wait to get indexed again. I may use your suggestion later, though. I have multipe lnaguages to support for all these pages with dozens of images for some of the pages. The images are the same for all languages, though, so I could defininately use your idea if needed.

Thanks!

If I kill the page in a robots.txt, yet have it linked to my real pages, will the page still be spidered via traversing the link? I wouldn't want these html pages indexed in google, is what I'm getting at.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SEO and AJAX