【问题标题】:Loading message on redirecting page在重定向页面上加载消息
【发布时间】:2013-10-13 23:49:22
【问题描述】:

我在 html 页面上有一个 php 支付按钮,当用户点击它时,他会被重定向到另一台服务器上的 url 以完成支付。无论如何,在它被重定向之前的加载时间通常太长,并且可能会使用户因几秒钟的不活动而感到困惑。 您能否建议我如何制作带有消息文本和动画 gif 的加载页面,一旦用户单击按钮就会出现?因此,用户会知道页面正在加载,他很快就会被重定向到专有的 url?

谢谢

【问题讨论】:

  • google "jquery 加载覆盖"

标签: php redirect


【解决方案1】:

您可以通过 jQuery 做到这一点。给按钮一个ID。然后在按钮上设置一个 onClick 事件。在页面的某处放置一个<div>,其中包含文本Loading... Please wait。 (您也可以添加动画 gif。)默认情况下将此 <div> 隐藏。然后设置此<div> 以在用户单击按钮时显示。

<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();
  });
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多