<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
<title>aaaaa</title>
<script type="text/javascript">
$(document).ready(function () {
$("#a").change(function () {
$.ajax({
type: 'POST',
data: {
data: $("#awardType").val(),
},
url: '${createLink(controller:' a ', action:' b ')}',
beforeSend: function () {
showAjaxLoading();
},
success: function (result) {
$('#a').html(result);
},
complete: function () {
hideAjaxLoading();
},
});
});
});
</script>
</head>
当我处理这个并将此脚本放在此文件中时......一切正常。但我把这个脚本带到另一个文件并调用该文件......它无法正常工作......
我有文件a.js并在此文件中加入脚本
并在html文件中调用它
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
<style type="text/css">
</style>
<title>
<g:message code="awards.title" default="Awards" />
</title>
<script type="text/javascript" src="${resource(dir: 'js', file: 'a.js') }"></script>
</head>
现在它无法正常工作......