dongpaipu8394 2014-10-17 14:12
浏览 55

跨页音乐播放器

I had an idea before and I thought that it won't be executed without an iframe or Ajax calls.

I couldn't keep an MP3 file or a radio channel working after changing the URL in the website, for example,

website.com/profile

To

website.com/news

The whole page will change of course, and the MP3, or radio have to load again.

But, I realized that SoundCloud has this feature - after playing a music, when exploring the site, the music keeps working, and when you comeback to the music page, it will be like you never left the page.

Also, Facebook uses this in the chat on the right. When you change the pages, most of the time, the chat won't get hurt by the change, meaning that the chat keeps working as if you're on the same page and never changed it.

  • 写回答

1条回答 默认 最新

  • doujuxin7392 2014-10-17 14:18
    关注

    Iframe and AJAX call is a only way to do it.
    Ajax Call is my favorite:

    $.ajax({
        url: "My URL",
        async: true
    }).done(function(result) {
        $("#mydiv").html(result);
    });
    
    评论

报告相同问题?

悬赏问题

  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 Macbookpro 连接热点正常上网,连接不了Wi-Fi。
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果