views:

32

answers:

1

I'm looking to direct the user on the channell webpage instead of the video url that I'm embedding. I've read the api and I didn't see any way to achieve this. I tried enclosing the embedded video in a and I added this code:

$('#youtube').click(function() {
    document.write('http://www.youtube.com/user/0plus1');
    return false;
});

And surprise it won't work.

How, if it's even possible I can do this?

+2  A: 

The document.write will do nothing. If you want to redirect, you should write

$('#youtube').click(function() {
  window.location.href = 'http://www.youtube.com/user/trasportareoggi';
  // or you could use window.replace('http://www.youtube.com/user/trasportareoggi');
  return false;
});
dan
Even like so doesn't work.
0plus1