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

HTML之间互相传参 随笔 第1张

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

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

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

HTML之间互相传参 随笔 第2张

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄