无法从asp.net Web服务获取数据 [英] unable to get the data from asp.net web service

查看:107
本文介绍了无法从asp.net Web服务获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的extjs商店是

My extjs store is

var myStore = new Ext.data.JsonStore({
autoLoad: true,
// Override default http proxy settings
proxy: new Ext.data.proxy.JsonP({
     type:''jsonp'',
    url: path+''SelectoccurList'',
    headers: {''Content-type'': ''application/json''},
    reader:    {
        type: ''json'',
        root: ''d''
    },

}),
   id: ''occurid'',
// Fields declaration
fields: [''occurid'',''occured'',''headline'',''source'',''enteredby'',''bodyintro'',''webaddress'',''location1'',''location2'',''location3'',''location4'',''image'',''occurtypeid'',''occursubtypeid'']
});



我得到了错误

语法错误:意外的令牌''<''

把我还给我



i get the error

SyntaxError: Unexpected token ''<''

and return me

<?xml version="1.0" encoding="utf-8"?>
**SelectOccurList:-1Resource interpreted as Script but transferred with MIME type      text/xml.
SelectOccurList:1SyntaxError: Unexpected token ''<''**
<ArrayOfOccurData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
<OccurData>
   <occurid>22</occurid>
   <occured>2012-05-26T04:33:53-04:00</occured>
   <headline>headline</headline>
   <source>content</source>
 <enteredby />
 <bodyintro>content</bodyintro>
<webaddress />
<location1>29 -156.364</location1>
<location2 />
<location3 />
<location4 />
<image>url of iamge</image>
<occurtypeid>0</occurtypeid>
<occursubtypeid>0</occursubtypeid>
</OccurData>
<OccurData>
 <occurid>23</occurid>
 <occured>2012-05-26T15:41:52-04:00</occured>
 <headline>headline</headline>
 <source>test content</source>
 <enteredby />
 <bodyintro>test content</bodyintro>
 <webaddress />
 <location1>27.75974 -82.67853</location1>
 <location2 />
 <location3 />
 <location4 />
  <image>url of image</image>
<occurtypeid />
<occursubtypeid />
 </OccurData>
<OccurData>
  <occurid>24</occurid>
  <occured>test</occured>
  <headline />
  <source />
  <enteredby />
  <bodyintro />
  <webaddress />
  <location1 />
  <location2 />
  <location3 />
  <location4 />
  <image />
  <occurtypeid>0</occurtypeid>
  <occursubtypeid>0</occursubtypeid>
 </OccurData>
<OccurData>
 <occurid>25</occurid>
 <occured>Testing</occured>
 <headline>Testing 28 05 </headline>
 <source>Dummy</source>
 <enteredby>XYZ</enteredby>
 <bodyintro>This occur is dummy</bodyintro>
 <webaddress>http://</webaddress>
 <location1>5cd41415-5c60-4cbd-a6f3-05330b368a41</location1>
 <location2 />
 <location3 />
 <location4 />
 <image />
 <occurtypeid>0</occurtypeid>
 <occursubtypeid>0</occursubtypeid>

推荐答案

这里可能的解决方法
ASP.NET Web服务-未捕获的语法错误:意外的令牌< [ ^ ]
还要检查一下
在ASP.NET 2.0中使用JQUERY [
Here possible solutions
ASP.NET webservice - Uncaught SyntaxError: Unexpected token <[^]
also check this
USING JQUERY WITH ASP.NET 2.0[^]


这篇关于无法从asp.net Web服务获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆