繁体   English   中英

如何在百里香中集成外部js资源

[英]how to integrate external js resource in thymeleaf

嗨,我对百里香很陌生,现在我想包括

行号:5

但我收到类似的错误

我有这样的尝试

<div xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
     layout:decorator="layout" layout:fragment="content">

<head>
    <title>Google Address Loopup Test</title>
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=false"></script>


    <script type='text/javascript' src='../js/jquery-latest.js'></script>

    <script type='text/javascript' src='jquery-latest.js'></script>

    <script type="text/javascript">
        $(function() {
        var input = document.getElementById('searchTextField');
        var autocomplete = new google.maps.places.Autocomplete(input);
        google.maps.event.addListener(autocomplete, 'place_changed', function() {
        var place = autocomplete.getPlace();
        /*$('#selected').text("Place selected:" +place.formatted_address)*/
        });
        });
    </script>



</head>
<body>
<div>
    <input id="searchTextField" type="text" size="50"/>
</div>

<!--<div id="selected">No address selected</div>-->
</body>
</div>

HTTP状态500-请求处理失败; 嵌套的异常是org.thymeleaf.exceptions.TemplateInputException:异常分析文档:template =“ test”,第5行-第103列

第5行是我上面粘贴的脚本代码。 有人可以帮我吗

您必须转义& , < , > and "字符。请尝试以下地址:
http://maps.googleapis.com/maps/api/js?libraries=places&amp;sensor=false

暂无
暂无

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

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