Search Engine Watch
SEO News

 

  #1  
Old 07-26-2010
BrianCosgrove BrianCosgrove is offline
Hire the agency I work for, TPG Direct!
 
Join Date: Mar 2007
Location: Philadelphia
Posts: 85
BrianCosgrove is on a distinguished road
Exclamation How not to do rel=canonical (for coders)

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>
Reply With Quote
  #2  
Old 07-26-2010
AussieWebmaster's Avatar
AussieWebmaster AussieWebmaster is offline
Forums Editor, SearchEngineWatch
 
Join Date: Jun 2004
Location: NYC
Posts: 8,197
AussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant future
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.
Reply With Quote
  #3  
Old 07-26-2010
BrianCosgrove BrianCosgrove is offline
Hire the agency I work for, TPG Direct!
 
Join Date: Mar 2007
Location: Philadelphia
Posts: 85
BrianCosgrove is on a distinguished road
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.
Reply With Quote
  #4  
Old 07-26-2010
AussieWebmaster's Avatar
AussieWebmaster AussieWebmaster is offline
Forums Editor, SearchEngineWatch
 
Join Date: Jun 2004
Location: NYC
Posts: 8,197
AussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant future
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.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 09:22 AM.