我是 AJAX 新手,正在尝试通过以下代码访问我们的 WSDL 数据库。当我运行它时,Firefox 调试器显示“[10:27:42.805] ReferenceError: $ is not defined @ http://newsite.wrapcompliance.org/ajaxtest.html:14 ”:想法?
<h3>jQuery Test</h3>
<script type="text/javascript">
function callService()
{
$.ajax
({
url: "http://newsite.wrapcompliance.org/FactoriesWS.wsdl",
type: "POST",
dataType: "xml",
data: {"countryCd":"BGD"},
contentType: "text/xml; charset=\"utf-8\"",
success: onSuccess,
error: onError
});
return false;
}
function onSuccess(data, status)
{
alert("It worked!!");
}
function onError(request, status, error)
{
alert("It didn't work!!!");
}
</script>
<form method="post" action="">
<input type="button" value="Do it now!!" onclick="callService(); return false"/>
</form>
</body>
</html>