使用变量javascript或php导航到url

使用变量javascript或php导航到url,javascript,php,angularjs,iframe,video,Javascript,Php,Angularjs,Iframe,Video,我需要帮助我的代码,使其正确,我所有的代码是好的,我只需要有人来编辑它为我和添加这几件事 在页面上,我有视频按钮、iframe和嵌入代码区 当我点击video按钮、video 1或video 2时,数据str将在iframe src和嵌入代码区域中更改,并且它将从按钮到url获取数据str值,使其类似于domain.com/test/page1.php?video=0_MfMUN_FNM 没关系,这是我想要的。但问题是,当我进入domain.com/test/page1.php?video=0_

我需要帮助我的代码,使其正确,我所有的代码是好的,我只需要有人来编辑它为我和添加这几件事

在页面上,我有视频按钮、iframe和嵌入代码区

当我点击video按钮、video 1或video 2时,数据str将在iframe src和嵌入代码区域中更改,并且它将从按钮到url获取数据str值,使其类似于domain.com/test/page1.php?video=0_MfMUN_FNM

没关系,这是我想要的。但问题是,当我进入domain.com/test/page1.php?video=0_-MfMUN_-FNM时,它不会加载视频3中数据str为“0_-MfMUN_-FNM”的视频,它会在10秒后加载默认视频,就像在视频1中一样

所以我希望它是这样的,当我转到domain.com/test/page1.php?video=0_-MfMUN_-FNM而不是domain.com/test/page1.php时,会选择video 3,因为url上的变量是“0_-MfMUN_-FNM”,10秒后应该播放,而不是默认播放

这是我在plnkr上的完整代码

这是我的javascript代码

<script>
    $(document).ready(function() {
      //action listener for video_link class
      $('.video_link').click(function(e) {
        e.preventDefault();
        $('.frame_src').attr('src', 'https://www.youtube.com/embed/' + $(this).data('str'));
        window.history.pushState({},"",window.location.origin + window.location.pathname + '?video=' + $(this).data('str'));
      });
        $(".frame_src").attr("data-src", "https://www.youtube.com/embed/p9zdCra9gCE");
        var t = "p9zdCra9gCE",
            e = $(".embed_code").attr("data-content");
        e = e.replace("[videoID]", t), $(".embed_code").html(e), $(".video_button").slideDown(), $(".video_link").click(function() {
            $(".reloadframe").show();
            var t = $(this).attr("data-str"),
                e = "https://www.youtube.com/embed/" + t + "",
                a = $(".embed_code").attr("data-content");
            a = a.replace("[videoID]", t), $(".embed_code").html(a), $(".frame_src").attr("src", e), clearInterval(interval), document.querySelector(".load_video").style.display = "none", $(".frame_src").show()
        })
    });
            </script>

$(文档).ready(函数(){
//视频链接类的操作侦听器
$('.video_link')。单击(函数(e){
e、 预防默认值();
$('.frame_src').attr('src','https://www.youtube.com/embed/'+$(this.data('str'));
window.history.pushState({},“,window.location.origin+window.location.pathname+”?video='+$(this.data('str'));
});
$(“.frame_src”).attr(“数据src”,”https://www.youtube.com/embed/p9zdCra9gCE");
var t=“p9zdCra9gCE”,
e=$(“.embed_code”).attr(“数据内容”);
e=e.replace(“[videoID]”,t),$(.embed_code”).html(e),$(.video_按钮”).slideDown(),$(.video_link”)。单击(函数(){
$(“.reloadframe”).show();
var t=$(this.attr(“数据str”),
e=”https://www.youtube.com/embed/“+t+”,
a=$(“.embed_code”).attr(“数据内容”);
a=a.replace(“[videoID]”,t),$(“.embed_code”).html(a),$(“.frame_src”).attr(“src”,e),clearInterval(interval),document.querySelector(.load_video”).style.display=“无,$(.frame_src”).show()
})
});

我只需要有人帮我编辑它,并添加这几件事
-你把雇佣一个代码猴子弄糊涂了,为什么你至少不试着自己学着去做呢?做一些尝试-然后你可以问一些你不能理解的问题。@user099023每个人都想说的是,你应该来这里问一个问题,而不是给我们代码,让别人帮你做。