2

我有一个应用程序,用户将从父网站重定向到我们的网站。我们将通过 SAML 流程获取用户的详细信息。根据收到的详细信息,如果用户是新用户,则将创建用户。所以动作会话/消费需要一些时间来处理。在动作完成之前是否可以显示加载图像或任何图像?这样用户就不会看到黑屏了。

4

2 回答 2

3

There are a couple ways you can do this. I think the easiest would probably to use JavaScript on the client side to make the "loading..." image appear when the user clicks on the link.

于 2012-11-03T04:39:07.093 回答
1

简单的方法是在rails中使用jquery。如果你想在提交表单后显示加载器直到操作完成。下面是简单的例子: <script type="text/javascript"> $("#me").click(function(){ $("#img").css("display","block"); }); </script> <%=submit_tag "Approve",:id=>"me"%> <p id="img" style="display:none;"><%= image_tag 'loader2.gif' %></p>

于 2012-11-03T06:34:14.407 回答