私は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>