【发布时间】:2013-04-09 01:13:37
【问题描述】:
我正在使用 Rails 发出搜索请求。
搜索表单的操作是某个路径 "/results/foo" .. 它会命中一个控制器,该控制器对输入进行一些验证,然后如果搜索文本是干净的,则重定向到 "results/foobar"。
<h1 class="center"><progress style="font-size: 160%;">Loading...</progress></h1>
我想显示上面的 html.. 并且只显示上面的 html(在视图中或通过 jquery),直到“results/foobar”完全加载。
有没有办法在最后一页完成加载之前显示这样的进度条动画 (html)?
更多详情(搜索栏页面有这样的代码):
<form class="form-search" action="/s_results/iscan" method="POST">
<div class="input-append">
<input name="searchtext" type="text" class="span4 search-query" placeholder="Type number here...">
<button type="submit" class="btn">
<i class="icon-search"></i>
Search
</button>
</div>
</form>
【问题讨论】:
-
您所说的涉及 AJAX,实际上更像是一个 JS 问题,尽管您的后端需要用有用的数据进行响应。也许提供更多信息,说明您正在处理什么样的进展。
-
嗨 @NathanLilienthal ,我只是想将上面的 html [] 显示为叠加层(高 z-index).. 或其他方法,直到我加载完最后一页。
-
啊,我误会了,我以为你在寻找更新进度。
-
还更新了添加“javascript”标签的问题。我可能很快就会对这个问题进行赏金!
标签: javascript jquery ruby-on-rails html angularjs