我想在 jsp 页面加载时调用 jquery ajax rest 服务调用,但很难让它工作。我没有看到我正在使用的以下代码有任何问题。任何建议将不胜感激
这是我的代码:
<script type="text/javascript">
$(function() {
var thisUrl = 'http://wwwtest.env.tree.org/url/api/filters/1234';
$.ajax({
type : "GET",
url : thisUrl,
dataType: 'json',
success : function(data) {
alert('data is:' + data);
$("#customText").text(data);
}
});
});