gpt4 book ai didi

javascript - $.get 不是 window.function 定义中的函数

转载 作者:行者123 更新时间:2023-11-30 09:30:13 26 4
gpt4 key购买 nike

<分区>

我遇到错误:

Uncaught TypeError: $.get is not a function

如果我在加载这个函数之前没有导入jquery我会理解

   <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"
integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"
integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"
integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn"
crossorigin="anonymous"></script>
<script>
window.loadCurrentLocation = function(){

$.get("{% url "locations:ajax_get_current_location" %}").done(function (data) {
{# TODO: Osetrit ak neexistuje#}
$('#id_my_current_location').text(data.name);
}
)
};

window.setUserLocation = function(){


var place_id = $('#id_this_place_id').val();
var name = $('#id_this_name').val();
$.get("{% url "locations:ajax_set_current_user_location" %}?place_id=" + place_id + "&name=" + name).done(function (data) {
loadCurrentLocation();
})
}
</script>

你知道问题出在哪里吗?

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com