简体   繁体   English

使用车把我得到这个错误:Uncaught TypeError:$(…).geocomplete不是一个函数

[英]Using handlebar I get this error :Uncaught TypeError: $(…).geocomplete is not a function

I am using this html code that I am trying to implement onto my handlebar file. 我正在使用要尝试在我的车把文件上实现的html代码。 While it works on the html/javascript file, I can't get it to work in the handlebar file. 虽然它可以在html / javascript文件中运行,但无法在车把文件中运行。

When I use it in the handlebar, I get this error : Uncaught TypeError: $(...).geocomplete is not a function 当我在车把上使用它时,出现以下错误:Uncaught TypeError:$(...)。geocomplete不是一个函数

I am putting the code into main.handlebar: 我将代码放入main.handlebar中:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script src="js/jquery.geocomplete.js"></script>

    <script language = "javascript">

        $(function(){

            $("#geocomplete").geocomplete().bind("geocode:result", function(event, result){
                        $.log("Result: " + result.formatted_address);
                    })
                    .bind("geocode:error", function(event, status){
                        $.log("ERROR: " + status);
                    })
                    .bind("geocode:multiple", function(event, results){
                        $.log("Multiple: " + results.length + " results found");
                    });


        });


    </script>

and it is not recognizing .geocomplete() method that is in js/jquery.geocomplete.js 并且无法识别js / jquery.geocomplete.js中的.geocomplete()方法

It recognizes it in a html file though. 它可以在html文件中识别它。

获取您的Google Maps JavaScript API的API密钥,然后将您的API密钥放入

<script src="https://maps.googleapis.com/maps/api/jskey=API_KEY_HERE&libraries=places"></script>

暂无
暂无

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

相关问题 使用 Fetch API 时,我收到此错误: Uncaught (in promise) TypeError: packages.map is not a function - When using Fetch API I get this error: Uncaught (in promise) TypeError: packages.map is not a function 为什么我得到 Uncaught TypeError: $(...).DataTable is not a function - Why I get Uncaught TypeError: $(…).DataTable is not a function 未捕获的TypeError:$ .get(...)。然后这不是一个函数 - Uncaught TypeError: $.get(…).then is not a function 为什么我会收到错误-indexOf未捕获的TypeError - Why i get a error - indexOf Uncaught TypeError 当我尝试使用名为“dinle()”的 output 和 function 时出现错误。 错误代码是:未捕获的类型错误: - I get an error when I try to output the function with the name `dinle()`. The error code is:Uncaught TypeError: 反应为什么我在调用作为参数传递的 function 时收到错误“Uncaught TypeError: createTask is not a function”? - REACT Why do I get the error "Uncaught TypeError: createTask is not a function" when calling a function passed as a parameter? 我正在尝试实现产品的添加和删除,但出现此错误:Uncaught TypeError: props.handleFavouriteClick is not a function - I am trying to implement the addition and removal of the product but I get this error:Uncaught TypeError: props.handleFavouriteClick is not a function 使用map函数时,如何得到“ Uncaught TypeError:结果不是函数” - What do I get 'Uncaught TypeError: results is not a function' when using map function JAVASCRIPT-&gt;为什么会收到错误消息“ Uncaught TypeError:number not a function”? - JAVASCRIPT --> Why do I get the error message “Uncaught TypeError: number is not a function ”? 当将Redux Saga与React一起使用时,出现此错误..未捕获的TypeError:getPosts不是函数 - When Using Redux Saga with React Get This Error .. Uncaught TypeError: getPosts is not a function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM