简体   繁体   English

在Dajax中更新GET请求

[英]Update GET request in Dajax

I am trying to make it possible to update search results with Dajax as you change the search parameters. 我试图在您更改搜索参数时使用Dajax更新搜索结果。 I have a GET request for the word search, and would like to modify it using Dajax. 我有一个GET请求来搜索单词,并想使用Dajax对其进行修改。

I understand this query has to be in POST format, but how can I combine the word search (currently GET) with the additional parameters (POST)? 我知道此查询必须采用POST格式,但是如何将单词搜索(当前为GET)与其他参数(POST)结合起来?

So far I am trying this, where variable 'request' is the GET request. 到目前为止,我正在尝试此操作,其中变量“ request”是GET请求。

<p onClick="Dajaxice.myapp.get_by_topic(request,{'data':{'mytopic':this.innerHTML}});">mytopic</p>

The Dajax project is pretty much dead. Dajax项目几乎已经死了。 He said it himself on the Github page. 他在Github页面上亲自说过。 https://github.com/jorgebastida/django-dajax/ It really offers nothing you're not capable of accomplishing on your own using a simple form post with jquery ajax. https://github.com/jorgebastida/django-dajax/它确实提供了您无法通过使用带有jquery ajax的简单表单发布自行完成的任何操作。

Why not post your search form to your view method using jquery Ajax which returns JSON and display that in your search results? 为什么不使用返回JSON并将其显示在搜索结果中的jquery Ajax将搜索表单发布到视图方法中呢? You can make the post on every space or every few letters etc... 您可以在每个空间或每隔几个字母等处发布帖子...

It may take some playing around with to get used to, but you're better off doing that than learning a dead library. 可能需要一些时间才能习惯,但是这样做比学习失效的库要好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM