English 中文(简体)
• 铁路和铁路 何时才能取得成果?
原标题:Rails & Backbone :: when to render results?

I m 使用有铁路的后装机(3.1)。 我有一个搜索页。 第一次搜索结果显示所有结果都ag缩,在页面负荷时应当提供。 后来的搜索要求将使用主干。 我如何在不违反南斯拉夫联邦共和国的情况下这样做?

我可以做所有关于后台的要求,但(1) 要求增加第2页的主干,以便启动收集工作。

来源:

Loading Bootstrapped Models When your app first loads, it s common to have a set of initial models that you know you re going to need, in order to render the page. Instead of firing an extra AJAX request to fetch them, a nicer pattern is to have their data already bootstrapped into the page. You can then use reset to populate your collections with the initial data. At DocumentCloud, in the ERB template for the workspace, we do something along these lines:

<script>
  Accounts.reset(<%= @accounts.to_json %>);
  Projects.reset(<%= @projects.to_json(:collaborators => true) %>);
</script>
最佳回答

您可以这样做,做所有后台工作,使服务器只能计算数据。

在第一次搜查时,你把探照结果作为“智者”列入你铁路的观点:

<script type= text/javascript >
   var search_results = new SearchResults(<%= results.to_json %>)
</script>

因此,你开始采用你的模式,让大家来做结果。 (你看不出结果。)

在随后的搜查中,你从铁路中获得了“JSON”的成果,并重新搜索了“后台”的收集结果。

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签