URL and Link repository

Tuesday, August 6, 2013

SEO Friendly Coding...

Generating text inside the JavaScript:
<'script type="text/javascript"'>
function onMouseOver1() {
var infoText = "info about button";
document.getElementById('infoblock').innerHTML = infoText;
}
<'/script>
<'body>
<'img src ="some.jpg" onmouseover="onMouseOver1()" />
<'div id="infoblock"><'/div>
<'/body>
Reportedly some search engines may skip over the infoText inside the JavaScript. Instead, try placing informational text inside the HTML code like this:
<'style type="text/css">
#infoblock1 {
display:none;
}
<'/style>
<'script type="text/javascript"'>
function onMouseOver1() {
document.getElementById('infoblock').innerHTML =
document.getElementById('infoblock1').innerHTML;
} <'/script>
<'body>
<'img src ="some.jpg" onmouseover="onMouseOver1()" />
<'div id="infoblock"><'/div>
<'div id="infoblock1">
info about button
<'/div>
<'/body>
}

No comments:

Post a Comment