
Originally Posted by
styxlawyer
Search engine robots do not click on menu buttons in any page, so will never see images loaded by JavaScript. However there's a trick you can use to overcome this.
The best way to ensure that Google and other search engines see the "alt" attributes of images is to pre-load them in an invisible part of the page. Put this code in at the start of your page and the search engines will find the "alt" attributes which they use to index images:
Code:
<div style="display:none;">
<img src="..." alt="...">
<img src="..." alt="...">
<img src="..." alt="...">
</div>
Hmmm, this isn't a great idea because it will have a negative impact on page performance - All the images will download in the background, even though they will not be seen.
Would it be best for me to just add some relevent text after the FIAt004 file name ?
Do you mean here?;
Code:
<li><a href="javascript:" onclick="replaceMainImage('m-images/photos/FIAT004.png', 'Fiat004','<b>£35.00</b><br>Chip Will Require Programming<br>Key Will Require Cutting<br><scan class=keychipColor>+ Virgin Chip & Uncut Key</scan><br><b>UK Recorded £2.50</b><br><b>International Signed For £10.00<br></b><b>Posted From The UK</b><br><scan class=drColor>The Remote Doctor</scan>')">One button key remote</a></li>
No, that wouldn't be the *best* thing you could do because Google wouldn't know how to associate the text with the image. In fact, Google wouldn't be able to tell from the markup that this is an image at all (its an anchor); <a href="javascript:" onclick="replaceMainImage('m-images/photos/FIAT004.png' ...
However, Google *can* tell that this is an image; <img src="m-images/photos/FIAT004.png" alt="Fiat Punto 3 Button Key Remote" /> Because it's programmed to recognise this img element as being an image.
The correct 'tool' for getting Google to associate text with an image is through the alt attribute and title attribute (to varying degrees) of an image tag. You can also use HTML5 captions.
I think the best thing you can do in your case, with the least disruption to your page and keeping the JavaScript functionality as is it, is to rename the files as previously discussed.
However, to do the job *properly* you might want to consider building the web pages over using the correct semantic markup. i.e. figure, img, figcaption, alt attribute and title attribute.
Bookmarks