V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
usw
V2EX  ›  问与答

使用 iframe 的 src 向内嵌的页面传递参数,内部使用 href 发现 hash 部分丢失

  •  
  •   usw · May 20, 2020 · 2181 views
    This topic created in 2168 days ago, the information mentioned may be changed or developed.
    即“<iframe src='/xxxx/xxxx.html#params1=xxx&params2=xxx'></iframe>”,内窗体使用 window.location.href 发现只剩下“/xxxx/xxxx.html”的部分

    木有源码,使用 tradingview 时偶然发现的问题
    4 replies    2020-05-21 09:43:48 +08:00
    TomatoYuyuko
        1
    TomatoYuyuko  
       May 20, 2020
    看一下是不是其他代码导致 url 的 hash 部分被覆盖或重置掉了
    usw
        2
    usw  
    OP
       May 20, 2020
    @TomatoYuyuko 全局搜了一下并没有这样的代码,而且是小概率发生,有父窗体去操作子窗体的可能吗
    usw
        3
    usw  
    OP
       May 20, 2020
    @TomatoYuyuko ng 做 https 转发的时候,能把 hash 部分 rewrite 掉吗?
    TomatoYuyuko
        4
    TomatoYuyuko  
       May 21, 2020
    @usw 你逐步打印 url 看看是在哪一步丢失 hash 的,父窗体可以操作子窗体,但是你要写了才行
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5316 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 01:13 · PVG 09:13 · LAX 18:13 · JFK 21:13
    ♥ Do have faith in what you're doing.