views:

82

answers:

1

Hi,

I need help of getting this piece of code to work

1) I want to automatically start a media player when a pop-up is open, by changing is URL params, that the pop-up has

2) When the user clicks on on the link I want to replace the old URL with the one the new one clicked. Try using location.replace just ends up being a constant loop.

Not having much luck with the code can anyone help????

 var vidlink = $('.link').attr('href');
 var autoplay = $('.link:first').attr('href'); 

  var myurl = window.location.href,
  paramsStr = autoplay,
  paramsObj = {};   
  var newUrl = $.param.querystring(myurl, paramsStr );

  if(window.location.href != newUrl){
    location.replace(newUrl);
 }  

 $('.link').click(function(){
        loadPlayer(vidlink);
      }); 

<a href="javascript:openplayer('http://localhost/player.php?v=0&amp;a=false');"&gt;Open Player</a>

player another show <a href='?v=53&a=false' class='link'>Ep2</a>
A: 

try windowname.document.location = newURL (where windoname is the name of the pop-up)

Diodeus
that didn't work, maybe I should have mentioned the pop-up link is on a completely different page I have no control of what being passed
NiseNise