小编Pyt*_*hos的帖子

<script>标记未正确关闭

在我的default.jspx中,它包含页面的基本布局,我试图导入一些jquery库,如下所示

<head>
    ...
    <spring:url value="/resources/js/lib/jquery-1.9.1.min.js" var="jquery_url" />
    <spring:url value="/resources/js/lib/jquery.tokeninput.js" var="jquery_tokeninput_url" />
    <script src="${jquery_url}" type="text/javascript"></script>    
    <script src="${jquery_tokeninput_url}" type="text/javascript"></script>
    <script type="text/javascript">
        $.noConflict();
    </script>
    <util:load-scripts />
    ...
</head>
Run Code Online (Sandbox Code Playgroud)

但是当页面在浏览器中呈现时,第一个脚本标记会吞下另外两个脚本标记

<head>
...
<script type="text/javascript" src="/roo-inari/resources/js/lib/jquery-1.9.1.min.js">
//These lines are inside the first script tag
<script type="text/javascript" src="/roo-inari/resources/js/lib/jquery.tokeninput.js"/>
<script type="text/javascript">
        $.noConflict();
//The tag is closed here
</script>
<link href="/roo-inari/resources/dijit/themes/tundra/tundra.css" type="text/css" rel="stylesheet">
...
Run Code Online (Sandbox Code Playgroud)

知道可能导致这种情况的原因吗?该项目基于spring roo生成的web mvc脚手架.我使用的是Chrome v.25.

javascript jquery jsp spring-mvc spring-roo

3
推荐指数
1
解决办法
1633
查看次数

标签 统计

javascript ×1

jquery ×1

jsp ×1

spring-mvc ×1

spring-roo ×1