|
#1
|
|||
|
|||
|
I explained rel=canonical to a company, after it was communicated a few times, this is what showed up at the top of their pages.
<script type="text/javascript"> window.onload = function() { var locationObj = window.location; var fileref=document.createElement("link"); fileref.setAttribute("rel", "canonical"); fileref.setAttribute("href", locationObj); // alert(locationObj); document.getElementsByTagName("head")[0].appendChild(fileref); } </script> |
|
#2
|
||||
|
||||
|
Re: How not to do rel=canonical (for coders)
does that work?
nothing like over kill
__________________
Grab a Halloween costume - marketing them can be fun too. |
|
#3
|
|||
|
|||
|
Re: How not to do rel=canonical (for coders)
Hi there, we met in Philly and at some past Conferences.
This doesn't work to well for SEO because search engines don't execute JavaScript. Plus it takes the current URL and uses it automatically, (even if that current URL isn't the right one) so conceptually, they missed the point of choosing a single URL per page. It's kinda crazy really. I need to explain to the IT guys that they need to do this server side so it explicitly makes a normal looking <link> element with the proper attributes and there can only be one URL per page. I thought it was interesting because essentially, this JavaScript does alot without accomplishing anything. I guess this is why we always have work as SEOs. |
|
#4
|
||||
|
||||
|
Re: How not to do rel=canonical (for coders)
that's what I thought - the simple rel tag would do
__________________
Grab a Halloween costume - marketing them can be fun too. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|