简体   繁体   English

无法从此脚本在哪里进行ajax调用(没有$ .ajax)

[英]Can't understand from where this script is making ajax call (no $.ajax)

I am a using ajax_select app for autocomplete, it is having its predefined JavaScript file for autocomplete, working fine for me, but I also want to add some extra paras in ajax call, now it is calling to url - 我正在使用ajax_select应用程序进行自动完成,它具有用于自动完成的预定义JavaScript文件,对我来说很好用,但是我也想在ajax调用中添加一些额外的参数,现在它正在调用url-

/ajax_select/ajax_lookup/sizes?term=lar

but what I want is: 但我想要的是:

/ajax_select/ajax_lookup/sizes?term=lar&filter=shoe

I tried many attempts but unable to add extra para because I am unable to understand how it is making ajax call and how it is passing parameters ? 我尝试了很多尝试,但是无法添加额外的para,因为我无法理解它如何进行ajax调用以及如何传递参数?

There is no $.ajax function ! 没有$.ajax函数! how it is going to possible ? 怎么可能?

This is full code of that js file: 这是该js文件的完整代码:

https://github.com/crucialfelix/django-ajax-selects/blob/develop/ajax_select/static/ajax_select/js/ajax_select.js https://github.com/crucialfelix/django-ajax-selects/blob/develop/ajax_select/static/ajax_select/js/ajax_select.js

I have read the documentation, there is noting related to it because it is a django app, there is not much info about its JavaScript file. 我已经阅读了文档,没有相关的注释,因为它是django应用程序,关于它的JavaScript文件没有太多信息。

I am not much familiar with JavaScript, anyone how can help me ? 我对JavaScript不太熟悉,任何人都可以帮助我吗?

I've no idea about django. 我对django一无所知。 If I didnt misunderstand; 如果我没有误会的话; you are trying to add extra paramter to ajax request. 您正在尝试向ajax请求添加额外的参数。 I looked up github repo of "django-ajax-selects" which you use. 我查找了您使用的“ django-ajax-selects”的github存储库。 The author says it depends on "jQuery UI AutoComplete" at repo's readme file. 作者说,这取决于repo自述文件中的“ jQuery UI AutoComplete”。 So you should search about "jQuery UI AutoComplete". 因此,您应该搜索“ jQuery UI AutoComplete”。 You can add extra paramters to "jQuery UI AutoComplete" Please look here ; 您可以在“ jQuery UI AutoComplete”中添加额外的参数。 How do I pass an extra parameter to Jquery Autocomplete field? 如何将额外的参数传递给Jquery自动完成字段? You should use jQuery UI AutoComplete's source method. 您应该使用jQuery UI AutoComplete的source方法。 Look at django-ajax-selects docs here for using source method: http://django-ajax-selects.readthedocs.io/en/latest/jQuery-plugin-options.html 在此处查看django-ajax-selects文档以使用源方法: http : //django-ajax-selects.readthedocs.io/en/latest/jQuery-plugin-options.html

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

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