HTML之间互相传参

如图所示,在index.html详情展示中给detailsPanel穿参数,在detailsPanel中获取到参数写ajax到后台获取json数据,那么如何在detailsPanel.html中获取传来的参数呢?

百转千回都是一种思路:截取+拼接

调用window.location.href

onload = function() {
        //取接收到的参数
        var href = window.location.href;
        var uuid = window.location.href.split("=")[1];
        console.log('href:', href);
        console.log('uuid:', uuid);    
    }

 

posted @ 2019-04-15 23:02  曾聪聪  阅读(467)  评论(0编辑  收藏  举报