使用jqueryajax客户端使用restfulweb服务

使用jqueryajax客户端使用restfulweb服务,jquery,ajax,web-services,rest,Jquery,Ajax,Web Services,Rest,我正在尝试设置jQuery客户端以使用MedlinePlus Web服务,但这是我第一次这样做,无法让它为我工作: 任何帮助都将不胜感激 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <

我正在尝试设置jQuery客户端以使用MedlinePlus Web服务,但这是我第一次这样做,无法让它为我工作: 任何帮助都将不胜感激

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Health Topics Web Service</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script language="javascript">
//http://www.nlm.nih.gov/medlineplus/webservices.html
$(document).ready(function(){
$('select').change(function(){
      $.ajax(
        { url: 'http://wsearch.nlm.nih.gov/ws/query?db=healthTopics&term='+this.value+'&rettype=topic',
        complete: function ( jsXHR, textStatus ) {
        var xmlResponse = $.parseXML(jsXHR.responseText),
            $xml = $(xmlResponse),
            $main = $xml.find('content name="title"'),
            $description = $xml.find('content name="FullSummary"'),
            $('h3#title').html("Title: "+$main.title());
            $('h3#FullSummary').html("Summary: "+$description.FullSummary());
          }
        }
      );

    });
});//ready
</script>
</head>
<body>
<div class="medical">
<h2>Health Topics Web Service</h2>
Select Word : <select name="title" style="width:120px;margin-left:10px;">
  <option value="">Select one</option>
  <option value="Diabetes">Diabetes</option>
  <option value="Migraine">Migraine</option>
</select>
<p id="vBox">
<h3 id="title"></h3>
<h3 id="FullSummary"></h3>
</p>
</div>
</body>
</html>

请提供您遇到的问题。我想你会遇到问题,因为url是从wsearch.nlm.nih.gov上下文外部访问的。如果您确定这是一个rest web服务调用,那么可以通过匹配某个URL模式对Servlet/ASP/PHP执行服务器调用内部调用,而不是直接的web服务调用,然后使用第三方RestClient库从那里调用web服务URL。我认为,您编写URL的方式与REST不符。不确定这是否是问题所在。如果您查看了jQuery的主页,那么这里将简要介绍ajax函数的所有参数。也许你可以在这里提出更具体的问题。嗨,马赫什,你可能就在那里。今晚我再看一次。