Googlebot and javascript
-
26-10-2019 - |
سؤال
My question is whether googlebot can track pages redirected through javascript onchange function:
Example:
<select id="bla">
<option value="1">page1</option>
<option value="2">page2</option>
</select>
<script type="text/javascript">
document.getElementById("bla").onchange = function() { // code to redirect }
</script>
Now, will googlebot be redirected to page2 or page1?
المحلول
According to the documentation they "may not":
"When Googlebot indexes a page containing JavaScript, it will index that page but it may not follow or index any links hidden in the JavaScript itself."
Check this link for a little bit more insight in the subject.
لا تنتمي إلى StackOverflow