doulun1915 2013-10-13 23:49
浏览 54

在重定向页面上加载消息

I have a php payment button on a html page, when the user clicks on it, he get redirected to a url on another server to complete the payment. Anyway the loading time before it gets redirected is often too much and can confuse the user with several seconds of inactivity. Can you advise how can I make loading page with message text and animation gif that appears as soon as the user clicks the button? Thus the user will be aware that the page is loading and he will be soon redirected to approprieted url?

Thanks

  • 写回答

1条回答 默认 最新

  • doubaoxue5788 2013-10-14 00:05
    关注

    You can do this through jQuery. Give the button an ID. then set an onClick event on the button. Somewhere in your page put a <div> which contains the text Loading... Please wait. (You can also add an animated gif.) By default make this <div> hidden. Then set this <div> to show when the user clicks the button.

    <div id="load"> <img src="loading.gif"/> Loading... Please wait</div>
    <button id='buttonID'>Button</button>
    
    $(document).ready(function (){
      //This line below would hide the div when the page load by default
      $('#load').hide();
    
      //This would display when the user clicks the button
      $('#buttonID').click(function (){
        $('#load').show();
      });
    });
    
    评论

报告相同问题?

悬赏问题

  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本