开发者

How to replace old URL in javascript pop-up with new URL

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);
 }  

 $(开发者_如何学C'.link').click(function(){
        loadPlayer(vidlink);
      }); 

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

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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜