Hello all.
The use of javascript frequently comes up in conversation. Everyone says "no, don't touch it" when it comes to SEO. Just wondered if anyone has a technical opinion on the following code and whether or not Googlebot + others can follow these links:
In the header tag:
Code:
<script language="javascript">
//detect browser:
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (browserName == "Netscape" && browserVer >= 3) browserVer = "1";
else if (browserName == "Microsoft Internet Explorer" && browserVer == 4) browserVer = "1";
else browserVer = "2";
//preload images:
if (browserVer == 1) {
home0 = new Image;
home0.src = "http://www.example.com/image0.PNG";
home1 = new Image;
home1.src = "http://www.example.com/image1.PNG";
}
//image swapping function:
function hiLite(imgDocID, imgObjName, comment) {
if (browserVer == 1) {
document.images[imgDocID].src = eval(imgObjName + ".src");
window.status = comment; return true;
}}
</script>
And then where the image is in the body:
Code:
