0
以下是代码。我已经研究过它,到目前为止还没有找到合适的解决方案。任何帮助将非常感激。谢谢。
<script type="text/javascript" src="{%static 'javascript/jquery-3.1.1.js'%}"></script>
<script type="text/javascript">
\t \t $(document).ready(function(){
\t \t \t $("#itemid").change(function(){
\t \t \t \t var itemid = $(this).val();
\t \t \t \t var func_url = '/get_itemdetails/' + itemid +'/';
\t \t \t \t $.ajax({
\t \t \t \t \t type:"GET",
\t \t \t \t \t url: func_url,
\t \t \t \t \t dataType:"json",
\t \t \t \t \t success: function(data){
\t \t \t \t \t \t console.log(data);
\t \t \t \t \t }
\t \t \t \t });
\t \t \t });
\t \t });
\t \t
\t </script>
HTTP:/ /api.jquery.com/jquery.ajax/,尝试'f ail'回调,看看有什么错误。 '$'是全球性的,不应该有这个问题。检查控制台内的'$' –
http://stackoverflow.com/questions/18271251/typeerror-ajax-is-not-a-function –
并非所有版本的jquery都带有$ .ajax函数。在您的版本中搜索,看看它是否有它。 –