- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我遇到 ajax 调用返回 json 的问题。我这样构造json文件:
$hotel_array2 = array();
.....
$hotel_array2['name'] = str_replace('\'', '', $hotel->HotelDetails->Name);
....
array_push($arr_return['hotel'], $hotel_array2);
echo(json_encode($arr_return));
ajax调用是这样的:
$.ajax({
url: site_url_veturis,
type: "GET",
async: true,
data: window.location.search,
dataType: "json",
timeout: 50000,
success: function(data) {
},
error: function(data) {
}
})
奇怪的问题是,如果我用 firebug 看到选项卡响应中的响应,json 是:
{"hotel":[{"id":"17911","provider_name":"veturis","provider":"veturis","session":"","name":"Thistle Liverpool
City Centre, Atlantic Tower","rating":4,"nation":"97","city":"394","nation_name":"","city_name":"","area_name"
:"","area_code":"","address":"CHAPEL STREET ","description":"HOTEL: This hotel and was built in 1975
. Was renovated in 1999, has 12 floors, 225 rooms, 217 double rooms and 2 suites. Clients have available
a lobby with a reception and lifts. \n\nSITUATION: This urban hotel, is located in a main street. It
is in a tourist area. 500 metres away, clients can find restaurants, bars and nightclubs. 1 kilometre
away, there are shops. \n\nROOM: The comfortable, en-suite rooms. They have a hairdryer, a direct line
telephone, satellite or cable television, a radio, a fridge, a minibar, fitted carpet, a safe-deposit
box and a central heating system. \n\nMEALS: Regarding gastronomy, the establishment has a buffet breakfast
and \u00e0 la carte or set-menu lunch and dinner. Dietary restrictions can be accomodated and special
dishes made. \n\nPAYMENT METHODS: Accepted payment methods are American Express, Visa, Eurocard, Mastercard
and Diners Club.","photo":"http:\/\/hoteles.veturis.com\/photos\/17\/17911_15.jpg","latitudine":"53
.4076538","longitudine":"-2.9936891","max_age_infant":"0","max_age_child":"12","status":"","currency"
:"EUR","order":"10000000","distance":"0.16","markup_agency":"15","type":"hotel"},{"id":"20770","provider_name"
:"veturis","provider":"veturis","session":"","name":"Campanile Liverpool","rating":2,"nation":"97","city"
:"394","nation_name":"","city_name":"","area_name":"","area_code":"","address":"CHALONER STREET - QUEENS
DOCK ","description":"HOTEL: This tourist hotel. Was built in 1990, has 100 rooms and 2 floors. Customers
have available a reception, a cosy bar, a restaurant, a conference room, internet, a laundry service
and a car park. \n\nSITUATION: It is situated near the historic harbour Albert Docks. This inviting
hotel, is a few minutes walk from the city centre, where you can find shops, leisure areas, monuments
and tourist points of interest. \n\nROOM: The rooms are cosy and they have an ensuite bathroom with
hairdryer. They have a direct line telephone, a radio and a central heating system. \n\nPAYMENT METHODS
: The establishment accepts American Express, Visa and Mastercard.","photo":"http:\/\/hoteles.veturis
.com\/photos\/20\/20770_4.jpg","latitudine":"53.3949623","longitudine":"-2.9839790","max_age_infant"
:"0","max_age_child":"12","status":"","currency":"EUR","order":"10000000","distance":"1.57","markup_agency"
:"15","type":"hotel"},{"id":"21903","provider_name":"veturis","provider":"veturis","session":"","name"
:"Britannia Adelphi","rating":3,"nation":"97","city":"394","nation_name":"","city_name":"","area_name"
:"","area_code":"","address":"RANELAGH PLACE , L3 5UL","description":"HOTEL: Urban and was built in 1914
. It has 6 floors, 402 rooms, 27 single rooms, 373 double rooms and 2 suites. In the establishment entrance
guests are offered a lobby with elevators, a reception with a safe deposit box, a currency exchange
, a car park and a garage. Customers have at their disposal a pub, a bar, a restaurant with highchairs
and internet. Some services offered by the establishment are room service and a laundry service. \n
\nSITUATION: This urban hotel, is situated in the city centre of Liverpool. 3 minutes away, guests can
find the Lime Street Station. \n\nROOM: The rooms comfortable, en-suite with hairdryer. They have a
direct line telephone, satellite or cable TV, a radio, internet, fitted carpet, a central heating system
and a safe-deposit box. \n\nFACILITIES: Customers have at their disposal a swimming pool, a bar, parasols
, a jacuzzi, a sauna, a solarium, a Turkish bath and a massage service. Clients can enjoy activities
such as squash and do aerobics. The establishment also has a gym. \n\nPAYMENT METHODS: Accepted payment
methods are American Express, Visa, Eurocard, Mastercard, Diners Club and EC. \n\nOTHERS: Regarding
gastronomy, clients can enjoy all meals in buffet form, \u00e0 la carte or set-menu lunch and a set-menu
dinner.","photo":"http:\/\/hoteles.veturis.com\/hotel-Britannia-Adelphi-F21903_1.jpg","latitudine":"53
.4051056","longitudine":"-2.9796340","max_age_infant":"0","max_age_child":"12","status":"","currency"
:"EUR","order":"10000000","distance":"0.87","markup_agency":"15","type":"hotel"},{"id":"40472","provider_name"
:"veturis","provider":"veturis","session":"","name":"Jurys Inn Liverpool","rating":3,"nation":"97","city"
:"394","nation_name":"","city_name":"","area_name":"","area_code":"","address":"Keel Wharf 31","description"
:"HOTEL: This hotel was built in 2008 air-conditioned and it has 310 large, comfortable rooms, with private
bathroom. Clients have available a lobby with a reception, a safe, a currency exchange, a lift, a bar
, a restaurant, conference facilities and a car park at an additional cost. \n\nSITUATION: This urban
hotel, is located close to the river. It is in Liverpool. It is in front of the new stadium and the
Congress Centre. It is located close to the historic dock Albert Docks. It is in the city centre. 200
metres from the establishment, you can find the train station Lime Street. It is 14 kilometres away
from John Lennon Airport. It is situated 60 kilometres away from Manchester Airport. 90 kilometres from
the establishment, guests will find Blackpool Airport. \n\nROOM: The rooms are large, bright and modern
. They have a bathroom, an air-conditioning system, internet, a radio, a television, a coffee maker,
a kettle, an individual air-conditioning system and individual heating. \n\nPAYMENT METHODS: Customers
can pay with credit cards, debit cards, American Express, Diners Club, Mastercard and Visa. \n\nOTHERS
: Regarding gastronomy, clients have English or continental breakfast and an \u00e0 la carte or set-menu
dinner. The establishment also offers meal service in the bar.","photo":"http:\/\/hoteles.veturis.com
\/photos\/40\/40472_1.jpg","latitudine":"53.3960730","longitudine":"-2.9879199","max_age_infant":"0"
,"max_age_child":"12","status":"","currency":"EUR","order":"10000000","distance":"1.39","markup_agency"
:"15","type":"hotel"},{"id":"23014","provider_name":"veturis","provider":"veturis","session":"","name"
:"Radisson Blu Liverpool","rating":4,"nation":"97","city":"394","nation_name":"","city_name":"","area_name"
:"","area_code":"","address":"OLD HALL STREET 107","description":"HOTEL: This urban is ideal for relaxing
hotel. Was opened in 2004, has 194 rooms, 9 floors, 189 double rooms and 5 suites. In the establishment
entrance guests are offered a large hall with an elevator, a reception with a safe deposit box, a currency
exchange and a cloakroom. Clients have available a caf\u00e9, a conference room, a cocktail bar, an
air-conditioned \u00e0 la carte restaurant and internet. Some of the services on offer are room service
and a laundry service. \n\nSITUATION: It is located in the city centre of Liverpool. It is in front
of the Mersey River. 500 metres away from the establishment, guests will find shops and leisure areas
. 100 metres away there is a public transport stop. It is situated 11.5 kilometres away from the airport
. \n\nROOM: The rooms comfortable, en-suite with hairdryer. They have a direct line telephone, satellite
TV, a radio, internet, a safe available at an additional cost, a minibar and a central heating system
. \n\nFACILITIES: Customers have at their disposal a covered pool, a gym, a sauna, a jacuzzi, a Turkish
bath, a massage service and a beauty treatment service. \n\nPAYMENT METHODS: The establishment accepts
American Express, Visa, Mastercard and Diners Club. \n\nOTHERS: Regarding gastronomy, clients have breakfast
in a buffet form and a set-menu lunch and dinner.","photo":"http:\/\/hoteles.veturis.com\/photos\/23
\/23014_2.jpg","latitudine":"53.4103012","longitudine":"-2.9960999","max_age_infant":"0","max_age_child"
:"12","status":"","currency":"EUR","order":"10000000","distance":"0.37","markup_agency":"15","type":"hotel"
},{"id":"68152","provider_name":"veturis","provider":"veturis","session":"","name":"Novotel Liverpool"
,"rating":4,"nation":"97","city":"394","nation_name":"","city_name":"","area_name":"","area_code":""
,"address":"40 HANOVER STREET ","description":"HOTEL: This hoterestauranter, was opened in 2009, has
209 rooms, a designer, a bar and a car park with a security system. This air-conditioned conference
, hotel, has a reception, a safe, a currency exchange, a lift, conference facilities, internet, room
service and a laundry service. \n\nSITUATION: This urban hotel, is located in Paradise Street and Hanover
Street. It is in the centre of Liverpool. Close to the establishment clients can find Matthew Street
and Cavern club. It is close to the Lime Street Station. It is 2 minutes away from the Liverpool One
Shopping Centre, where you can find restaurants, bars and shops. It is 10 kilometres away from John
Lennon Airport. \n\nROOM: The rooms are modern and comfortable, have ensuite bathrooms with bath or
shower, a sofa-bed, a large workspace, an LCD television, films available at an additional cost, internet
, a hairdryer, an ironing set, computer safe, a minibar, a coffee maker, a kettle, an individual air-conditioning
system and a central heating system. \n\nFACILITIES: Guests have at their disposal a sauna, hydromassage
, tanning salon, a gym and a covered heated swimming pool. Some services for an additional fee. \n\nOTHERS
: Regarding gastronomy, the establishment offers a buffet breakfast. It has the Elements <with_breakfast_lunch_dinner_service
Id=\"N-2877451-2765654\">with A Breakfast, Lunch And Dinner Service<\/with_breakfast_lunch_dinner_service
> Restaurant. \n\nPAYMENT METHODS: Accepted payment methods are credit cards, American Express, Diners
Club, Mastercard, Visa and debit cards.","photo":"http:\/\/hoteles.veturis.com\/photos\/68\/68152_8
.jpg","latitudine":"53.4029200","longitudine":"-2.9844403","max_age_infant":"0","max_age_child":"12"
,"status":"","currency":"EUR","order":"10000000","distance":"0.77","markup_agency":"15","type":"hotel"
},{"id":"67575","provider_name":"veturis","provider":"veturis","session":"","name":"Hope Street Hotel"
,"rating":4,"nation":"97","city":"394","nation_name":"","city_name":"","area_name":"","area_code":""
,"address":"40 HOPE STREET ","description":"HOTEL:\nBuilt around 1860 in the style of a Venetian palazo
- a fashionable look of the day. Reinvented and renovated in 2003 into 48 simple, stylish, contemporary
and comfortable rooms with a restaurant. Privately owned and independently run with an emphasis on friendliness
, good food and thoughtful service.\n\nSITUACI\u00d3N:\nSitting pretty between two magnificent cathedrals
, surrounded by two famous theatres, two legendary pubs, one treasured concert hall, and an abundance
and variety of restaurants. Further afield they are a five minute walk into town and a 20 min drive
to Liverpool John Lennon Airport.\n\nHABITACI\u00d3N:\n48 individually designed rooms, solid wood floors
warmed by under floor heating and king sized beds draped in Egyptian cotton. Rain dance showerheads
the size of dinner plates and Vola fittings complement timeless bathrooms that also include huge soft
towels, mist free mirrors and REN products. Wall mounted LCD wide screen TVs, DVD and CD players and
Arne Jacobsen telephones, along with complimentary broadband access in every room.\n\nCOMO LLEGAR:\nBy
Car: From Liverpool John Lennon Airport - Depart. At the roundabout, take the first exit. At the roundabout
, take the first exit onto Speke Hall Avenue. At the roundabout, take the second exit onto Speke Hall
Avenue. Turn left onto Speke Road A561. the roundabout, take the first exit onto Speke Road A561. Continue
onto A561. Turn left onto Dingle Lane A561. Turn right onto Park Road A561. Continue onto A561. Bear
right onto Great George Street A5038. Bear right onto Berry Street A5038. Turn right onto Leece Street
A5039. Continue onto A5039. Turn right onto Pilgrim Street. Turn left onto Back Hope Place. Arrive.
\n\nMETODOS DE PAGO:\nVisa, American Express, MasterCard, Maestro and cash are accepted as methods of
payment.\n\nOTRAS:\nThe London Carriage Works: modern international food, complemented by the use of
local, organic and fresh seasonal produce. One of Liverpools leading restaurants, enjoying rave reviews
and critical acclaim. It was voted one of the top ten restaurants outside London in the 2005 Hardens
Guide and achieved Liverpools highest score for cooking in The Good Food Guide 2006. Most recently it
won Taste of Englands Northwest 2008.","photo":"http:\/\/hoteles.veturis.com\/photos\/67\/67575_1.jpg"
,"latitudine":"53.4008340","longitudine":"-2.9710220","max_age_infant":"0","max_age_child":"12","status"
:"","currency":"EUR","order":"10000000","distance":"1.60","markup_agency":"15","type":"hotel"}],"room"
:[],"amenities":[]}
如果在 firebug 中我点击响应,但 HTML json 是:
{"hotel":[{"id":"17911","provider_name":"veturis","provider":"veturis","session":"","name":"Thistle Liverpool City Centre, Atlantic Tower","rating":4,"nation":"97","city":"394","nation_name":"","city_name":"","area_name":"","area_code":"","address":"CHAPEL STREET ","description":"HOTEL: This hotel and was built in 1975. Was renovated in 1999, has 12 floors, 225 rooms, 217 double rooms and 2 suites. Clients have available a lobby with a reception and lifts. \n\nSITUATION: This urban hotel, is located in a main street. It is in a tourist area. 500 metres away, clients can find restaurants, bars and nightclubs. 1 kilometre away, there are shops. \n\nROOM: The comfortable, en-suite rooms. They have a hairdryer, a direct line telephone, satellite or cable television, a radio, a fridge, a minibar, fitted carpet, a safe-deposit box and a central heating system. \n\nMEALS: Regarding gastronomy, the establishment has a buffet breakfast and \u00e0 la carte or set-menu lunch and dinner. Dietary restrictions can be accomodated and special dishes made. \n\nPAYMENT METHODS: Accepted payment methods are American Express, Visa, Eurocard, Mastercard and Diners Club.","photo":"http:\/\/hoteles.veturis.com\/photos\/17\/17911_15.jpg","latitudine":"53.4076538","longitudine":"-2.9936891","max_age_infant":"0","max_age_child":"12","status":"","currency":"EUR","order":"10000000","distance":"0.16","markup_agency":"15","type":"hotel"},{"id":"20770","provider_name":"veturis","provider":"veturis","session":"","name":"Campanile Liverpool","rating":2,"nation":"97","city":"394","nation_name":"","city_name":"","area_name":"","area_code":"","address":"CHALONER STREET - QUEENS DOCK ","description":"HOTEL: This tourist hotel. Was built in 1990, has 100 rooms and 2 floors. Customers have available a reception, a cosy bar, a restaurant, a conference room, internet, a laundry service and a car park. \n\nSITUATION: It is situated near the historic harbour Albert Docks. This inviting hotel, is a few minutes walk from the city centre, where you can find shops, leisure areas, monuments and tourist points of interest. \n\nROOM: The rooms are cosy and they have an ensuite bathroom with hairdryer. They have a direct line telephone, a radio and a central heating system. \n\nPAYMENT METHODS: The establishment accepts American Express, Visa and Mastercard.","photo":"http:\/\/hoteles.veturis.com\/photos\/20\/20770_4.jpg","latitudine":"53.3949623","longitudine":"-2.9839790","max_age_infant":"0","max_age_child":"12","status":"","currency":"EUR","order":"10000000","distance":"1.57","markup_agency":"15","type":"hotel"},{"id":"21903","provider_name":"veturis","provider":"veturis","session":"","name":"Britannia Adelphi","rating":3,"nation":"97","city":"394","nation_name":"","city_name":"","area_name":"","area_code":"","address":"RANELAGH PLACE , L3 5UL","description":"HOTEL: Urban and was built in 1914. It has 6 floors, 402 rooms, 27 single rooms, 373 double rooms and 2 suites. In the establishment entrance guests are offered a lobby with elevators, a reception with a safe deposit box, a currency exchange, a car park and a garage. Customers have at their disposal a pub, a bar, a restaurant with highchairs and internet. Some services offered by the establishment are room service and a laundry service. \n\nSITUATION: This urban hotel, is situated in the city centre of Liverpool. 3 minutes away, guests can find the Lime Street Station. \n\nROOM: The rooms comfortable, en-suite with hairdryer. They have a direct line telephone, satellite or cable TV, a radio, internet, fitted carpet, a central heating system and a safe-deposit box. \n\nFACILITIES: Customers have at their disposal a swimming pool, a bar, parasols, a jacuzzi, a sauna, a solarium, a Turkish bath and a massage service. Clients can enjoy activities such as squash and do aerobics. The establishment also has a gym. \n\nPAYMENT METHODS: Accepted payment methods are American Express, Visa, Eurocard, Mastercard, Diners Club and EC. \n\nOTHERS: Regarding gastronomy, clients can enjoy all meals in buffet form, \u00e0 la carte or set-menu lunch and a set-menu dinner.","photo":"http:\/\/hoteles.veturis.com\/hotel-Britannia-Adelphi-F21903_1.jpg","latitudine":"53.4051056","longitudine":"-2.9796340","max_age_infant":"0","max_age_child":"12","status":"","currency":"EUR","order":"10000000","distance":"0.87","markup_agency":"15","type":"hotel"},{"id":"40472","provider_name":"veturis","provider":"veturis","session":"","name":"Jurys Inn Liverpool","rating":3,"nation":"97","city":"394","nation_name":"","city_name":"","area_name":"","area_code":"","address":"Keel Wharf 31","description":"HOTEL: This hotel was built in 2008 air-conditioned and it has 310 large, comfortable rooms, with private bathroom. Clients have available a lobby with a reception, a safe, a currency exchange, a lift, a bar, a restaurant, conference facilities and a car park at an additional cost. \n\nSITUATION: This urban hotel, is located close to the river. It is in Liverpool. It is in front of the new stadium and the Congress Centre. It is located close to the historic dock Albert Docks. It is in the city centre. 200 metres from the establishment, you can find the train station Lime Street. It is 14 kilometres away from John Lennon Airport. It is situated 60 kilometres away from Manchester Airport. 90 kilometres from the establishment, guests will find Blackpool Airport. \n\nROOM: The rooms are large, bright and modern. They have a bathroom, an air-conditioning system, internet, a radio, a television, a coffee maker, a kettle, an individual air-conditioning system and individual heating. \n\nPAYMENT METHODS: Customers can pay with credit cards, debit cards, American Express, Diners Club, Mastercard and Visa. \n\nOTHERS: Regarding gastronomy, clients have English or continental breakfast and an \u00e0 la carte or set-menu dinner. The establishment also offers meal service in the bar.","photo":"http:\/\/hoteles.veturis.com\/photos\/40\/40472_1.jpg","latitudine":"53.3960730","longitudine":"-2.9879199","max_age_infant":"0","max_age_child":"12","status":"","currency":"EUR","order":"10000000","distance":"1.39","markup_agency":"15","type":"hotel"},{"id":"23014","provider_name":"veturis","provider":"veturis","session":"","name":"Radisson Blu Liverpool","rating":4,"nation":"97","city":"394","nation_name":"","city_name":"","area_name":"","area_code":"","address":"OLD HALL STREET 107","description":"HOTEL: This urban is ideal for relaxing hotel. Was opened in 2004, has 194 rooms, 9 floors, 189 double rooms and 5 suites. In the establishment entrance guests are offered a large hall with an elevator, a reception with a safe deposit box, a currency exchange and a cloakroom. Clients have available a caf\u00e9, a conference room, a cocktail bar, an air-conditioned \u00e0 la carte restaurant and internet. Some of the services on offer are room service and a laundry service. \n\nSITUATION: It is located in the city centre of Liverpool. It is in front of the Mersey River. 500 metres away from the establishment, guests will find shops and leisure areas. 100 metres away there is a public transport stop. It is situated 11.5 kilometres away from the airport. \n\nROOM: The rooms comfortable, en-suite with hairdryer. They have a direct line telephone, satellite TV, a radio, internet, a safe available at an additional cost, a minibar and a central heating system. \n\nFACILITIES: Customers have at their disposal a covered pool, a gym, a sauna, a jacuzzi, a Turkish bath, a massage service and a beauty treatment service. \n\nPAYMENT METHODS: The establishment accepts American Express, Visa, Mastercard and Diners Club. \n\nOTHERS: Regarding gastronomy, clients have breakfast in a buffet form and a set-menu lunch and dinner.","photo":"http:\/\/hoteles.veturis.com\/photos\/23\/23014_2.jpg","latitudine":"53.4103012","longitudine":"-2.9960999","max_age_infant":"0","max_age_child":"12","status":"","currency":"EUR","order":"10000000","distance":"0.37","markup_agency":"15","type":"hotel"},{"id":"68152","provider_name":"veturis","provider":"veturis","session":"","name":"Novotel Liverpool","rating":4,"nation":"97","city":"394","nation_name":"","city_name":"","area_name":"","area_code":"","address":"40 HANOVER STREET ","description":"HOTEL: This hoterestauranter, was opened in 2009, has 209 rooms, a designer, a bar and a car park with a security system. This air-conditioned conference, hotel, has a reception, a safe, a currency exchange, a lift, conference facilities, internet, room service and a laundry service. \n\nSITUATION: This urban hotel, is located in Paradise Street and Hanover Street. It is in the centre of Liverpool. Close to the establishment clients can find Matthew Street and Cavern club. It is close to the Lime Street Station. It is 2 minutes away from the Liverpool One Shopping Centre, where you can find restaurants, bars and shops. It is 10 kilometres away from John Lennon Airport. \n\nROOM: The rooms are modern and comfortable, have ensuite bathrooms with bath or shower, a sofa-bed, a large workspace, an LCD television, films available at an additional cost, internet, a hairdryer, an ironing set, computer safe, a minibar, a coffee maker, a kettle, an individual air-conditioning system and a central heating system. \n\nFACILITIES: Guests have at their disposal a sauna, hydromassage, tanning salon, a gym and a covered heated swimming pool. Some services for an additional fee. \n\nOTHERS: Regarding gastronomy, the establishment offers a buffet breakfast. It has the Elements with A Breakfast, Lunch And Dinner Service<\/with_breakfast_lunch_dinner_service> Restaurant. \n\nPAYMENT METHODS: Accepted payment methods are credit cards, American Express, Diners Club, Mastercard, Visa and debit cards.","photo":"http:\/\/hoteles.veturis.com\/photos\/68\/68152_8.jpg","latitudine":"53.4029200","longitudine":"-2.9844403","max_age_infant":"0","max_age_child":"12","status":"","currency":"EUR","order":"10000000","distance":"0.77","markup_agency":"15","type":"hotel"},{"id":"67575","provider_name":"veturis","provider":"veturis","session":"","name":"Hope Street Hotel","rating":4,"nation":"97","city":"394","nation_name":"","city_name":"","area_name":"","area_code":"","address":"40 HOPE STREET ","description":"HOTEL:\nBuilt around 1860 in the style of a Venetian palazo - a fashionable look of the day. Reinvented and renovated in 2003 into 48 simple, stylish, contemporary and comfortable rooms with a restaurant. Privately owned and independently run with an emphasis on friendliness, good food and thoughtful service.\n\nSITUACI\u00d3N:\nSitting pretty between two magnificent cathedrals, surrounded by two famous theatres, two legendary pubs, one treasured concert hall, and an abundance and variety of restaurants. Further afield they are a five minute walk into town and a 20 min drive to Liverpool John Lennon Airport.\n\nHABITACI\u00d3N:\n48 individually designed rooms, solid wood floors warmed by under floor heating and king sized beds draped in Egyptian cotton. Rain dance showerheads the size of dinner plates and Vola fittings complement timeless bathrooms that also include huge soft towels, mist free mirrors and REN products. Wall mounted LCD wide screen TVs, DVD and CD players and Arne Jacobsen telephones, along with complimentary broadband access in every room.\n\nCOMO LLEGAR:\nBy Car: From Liverpool John Lennon Airport - Depart. At the roundabout, take the first exit. At the roundabout, take the first exit onto Speke Hall Avenue. At the roundabout, take the second exit onto Speke Hall Avenue. Turn left onto Speke Road A561. the roundabout, take the first exit onto Speke Road A561. Continue onto A561. Turn left onto Dingle Lane A561. Turn right onto Park Road A561. Continue onto A561. Bear right onto Great George Street A5038. Bear right onto Berry Street A5038. Turn right onto Leece Street A5039. Continue onto A5039. Turn right onto Pilgrim Street. Turn left onto Back Hope Place. Arrive.\n\nMETODOS DE PAGO:\nVisa, American Express, MasterCard, Maestro and cash are accepted as methods of payment.\n\nOTRAS:\nThe London Carriage Works: modern international food, complemented by the use of local, organic and fresh seasonal produce. One of Liverpools leading restaurants, enjoying rave reviews and critical acclaim. It was voted one of the top ten restaurants outside London in the 2005 Hardens Guide and achieved Liverpools highest score for cooking in The Good Food Guide 2006. Most recently it won Taste of Englands Northwest 2008.","photo":"http:\/\/hoteles.veturis.com\/photos\/67\/67575_1.jpg","latitudine":"53.4008340","longitudine":"-2.9710220","max_age_infant":"0","max_age_child":"12","status":"","currency":"EUR","order":"10000000","distance":"1.60","markup_agency":"15","type":"hotel"}],"room":[],"amenities":[]}
好的,在 javascript 中我必须在成功回调中执行此操作:
var data_hotel = data.hotel;
var string_hotel = JSON.stringify(data_hotel)
在 stringify 行上向我返回此错误:
SyntaxError: JSON.parse: expected ',' or '}' after property value in object at line 1 column 9574 of the JSON data
但是如果我以这种方式从 firebug 选项卡 HTML(而不是响应选项卡)复制响应:
var data_response = '{"hotel":[{"id":"17911","provider_name":"ve....}]} '; // I can't copy because is too long for a stackoverflow question
var data_hotel = data_response.hotel;
var string_hotel = JSON.stringify(data_hotel)
这工作正常并且不会返回错误。为什么??
最佳答案
如果我错了,请纠正我,但似乎当你打电话时
var data_hotel = data_response.hotel;
您已经指向酒店元素,这意味着您应该进行字符串化
var string_hotel = JSON.stringify(data_hotel)
而不是
var string_hotel = JSON.stringify(data_hotel.hotel)
关于javascript - 使用 ajax 调用进行 JSON 字符串化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32697672/
有人有 Comet 应用程序 .net 的任何样本吗? 我需要一个示例如何在服务器中保持客户端的连接? 最佳答案 这里也有一些不错的: http://www.frozenmountain.com/we
我想知道是否有 Yii2 专家可以帮助我了解如何最好地使用 ajax 表单与 Yii ajax 验证相结合。我想我可以在不带您阅读我所有代码的情况下解释这个问题。 我正在处理一个促销代码输入表单,用户
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求提供代码的问题必须表现出对所解决问题的最低限度的了解。包括尝试的解决方案、为什么它们不起作用以及预期结果
f:ajax 和 a4j:ajax 标记之间有什么显着差异吗? 我知道 Richfaces 4 中的 a4j:ajax 基于 native f:ajax JSF2 标记,添加了一些 f:ajax 中未
我已经尝试过这样但无法获取数组列表。它返回“null” var data=[]; data[0] = '1'; data[1] = '2'; $.ajax({
在教程中可以看到 jQuery.ajax 和 $.ajax 喜欢这里 http://www.thekludge.com/form-auto-save-with-jquery-serialize/ jQ
过度使用 AJAX 会影响性能吗?在大型 Web 应用程序的上下文中,您如何处理 AJAX 请求以控制异步请求? 最佳答案 过度使用任何东西都会降低性能;在必要时使用 AJAX 将提高性能,特别是如果
似乎我无法使用 Ext.Ajax.request 进行跨域 ajax 调用。看起来 ScriptTag: True 没有任何效果。 这是我的代码: {
我正在使用 Bottle 微框架(但我怀疑我的问题来自它) 首先,如果我定义了一个从/test_redirect 到/x 的简单重定向,它会起作用。所以 Bottle redirect() 在简单的情
任何人都可以指出各种 AJAX 库的统一比较吗?我已经阅读了大约十几种不同的书,我即将开始一个项目,但我对自己是否已经探索了可能性的空间没有信心。 请注意,我不是在要求“我认为 XXX 很棒”——我正
似乎使用 AJAX 的站点和应用程序正在迅速增长。使用 AJAX 的主要原因之一可能是增强用户体验。我担心的是,仅仅因为项目可以使用 AJAX,并不意味着它应该。 可能是为了 UX,AJAX 向站点/
假设我有一个可以通过 Javascript 自定义的“报告”页面。假设我有可以更改的 start_date、end_date 和类型(“简单”或“完整”)。现在 我希望地址栏始终包含当前(自定义) V
我一直在阅读 Ajax 并且希望从 stackoverflow 社区看到我是否正确理解所有内容。 因此,正常的客户端服务器交互是用户在 url 中拉出 Web 浏览器类型,并将 HTTP 请求发送到服
这可能有点牵强,但让我们假设我们需要它以这种方式工作: 我在服务器的 web 根目录中有一个 index.html 文件。该文件中的 javascript 需要向/secure/ajax.php 发出
关闭。这个问题是opinion-based .它目前不接受答案。 想改进这个问题?更新问题,以便 editing this post 可以用事实和引用来回答它. 去年关闭。 Improve this
我希望ajax post成功进入主页。由于某种原因,我一直做错事。知道我应该做什么来解决这个问题吗? window.APP_ROOT_URL = ""; Ajax $.ajax({ url: '#{a
我在 2 个不同的函数中有 2 个 ajax 调用。我想用.click来调用这2个函数。 func1 将数据插入数据库,然后 func2 检索数据,所以我的问题是如何等到 func1 完全完成然后只执
我试图在单击按钮后禁用该按钮。我尝试过: $("#ajaxStart").click(function() { $("#ajaxStart").attr("disabled", true);
我试图在每个 Ajax 请求上显示加载动画/微调器 我的 application.js $(document).on("turbolinks:load", function() { window.
我正在显示使用jQplot监视数据的图形。 为了刷新保存该图的div,我每5秒调用一次ajax调用(请参见下面的JavaScript摘录)。 在服务器上,PHP脚本从数据库中检索数据。 成功后,将在5
我是一名优秀的程序员,十分优秀!