返回一个特定数据

时间:2016-12-02 19:05:58

标签: jquery html ajax xml

我想专门从xml返回一个数据。

如果nameOfBusiness = Restaurant,则返回所有评级(三家餐厅),其中包含具有餐厅的商品名称。

我怎样才能让它只提醒一家餐厅而不包括另外两家餐厅(有Steams and Origins)?

这是我的xml:

if request.user.is_authenticated():

    return HttpResponse("OK")
else:

    return HttpResponse("Load_Login_Form")

这是我的ajax代码:

<resultitem>
 <itemname>Restaurant</itemname>
 <rating>3</rating>
</resultitem>
<resultitem>
 <itemname>Restaurant Origins</itemname>
 <rating>4</rating>
</resultitem>
<resultitem>
 <itemname>Restaurant Steams</itemname>
 <rating>4.1</rating>
</resultitem>

0 个答案:

没有答案