sevenQu
V2EX  ›  HTML

网页,嵌入网易云音乐,直接复制网易云音乐给的代码,显示跨域,不知道应该如何解决?

  •  1
     
  •   sevenQu · Apr 18, 2018 · 6563 views
    This topic created in 2952 days ago, the information mentioned may be changed or developed.
    <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width="330" height="450" src="//&lt;a href=" http:="" <a="" href="http://music.163.com" rel="nofollow">music.163.com="" outchain="" player?type="0&id=953939511&auto=1&height=430"" rel="nofollow">music.163.com/outchain/player?type=0&id=953939511&auto=1&height=430"></iframe>

    iframe 或者 flask 插件版我都试了,都会显示跨域

    那不就等于网易云这个不就是没用的?我看到其他网页,还是有可以使用成功的,不知道怎么做?希望有人可以指点一下,谢谢

    5 replies    2021-12-28 14:17:12 +08:00
    swuzjb
        1
    swuzjb  
       Apr 18, 2018
    因为你搞了 https ?
    xiaopc
        2
    xiaopc  
       Apr 18, 2018 via Android
    配置你 Web Server 的 X-Frame-Options 头
    sevenQu
        3
    sevenQu  
    OP
       Apr 18, 2018
    @swuzjb 我什么都没做,就是一个 html 原始的网页很简单的那种
    sevenQu
        4
    sevenQu  
    OP
       Apr 18, 2018
    @xiaopc 这个涉及到后端配合了吧,网易云音乐给的本来的标签里已经进行请求了,不知道有没有什么简单的做法?
    yaooo
        5
    yaooo  
       Dec 28, 2021
    <iframe frameborder="no"
    border="0"
    marginwidth="0"
    marginheight="0"
    width=510
    height=86
    scrolling="no"
    src="https://music.163.com/outchain/player?type=2&id=1413863166&auto=0&height=66"
    align=center></iframe>
    我的这个可以用,你试试
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1111 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 855ms · UTC 18:17 · PVG 02:17 · LAX 11:17 · JFK 14:17
    ♥ Do have faith in what you're doing.