//LIST based on # people, Dates and location - hotels are returned based on hotels that match requirements in chosen area.
// DO NOT USE THIS URL IN YOUR CODE - contact Andrew Pougher if you need tutorial for EAN
// can use &latitude=40.4167754&longitude=-3.7037901999999576 or &city=Chamonix&stateProvinceCode=&countryCode=FR
var url = "http://api.ean.com/ean-services/rs/hotel/v3/list?minorRev=20&apiKey=p9ycn9cxb2zp3k3gfvbf5aym&sig=5fca2cc7ad34205fca91e92f72390561&cid=55505&locale=en_GB&city=Chamonix&stateProvinceCode=&countryCode=FR&room1=4&room2=2&room3=3&numberOfResults=5&arrivalDate=4/20/2013&departureDate=4/22/2013¤cyCode=GBP&sort=PRICE"
$.ajax({
url: url,
dataType: 'jsonp',
beforeSend: function () {
$("#loading").html('loading...');
},
success: function (data) {
var base = (data.HotelListResponse.HotelList.HotelSummary)
var customerSessID = (data.HotelListResponse.customerSessionId);
$("body").prepend(customerSessID + "<br>")
// START MAIN LOOP
var clusterMarkers = [];
$(base).each(function (eventID,eventData){
//$.each(base.HotelList, function(eventID,eventData) {
// IMS
var singlePic = [];
$(this).each(function(index,val) {
singlePic.push(val.thumbNailUrl);
});
//Loaction Info
var locInfo = [];
$(this).each(function(index,val) {
locInfo.push(val.locationDescription);
});
//COST Info
var rtotal = [];
var cur = [];
var roomGroupPpl = [];
$(this.RoomRateDetailsList).each(function(index) {
rtotal.push( this.RoomRateDetails.RateInfos.RateInfo.ChargeableRateInfo['@total'] );
cur.push( this.RoomRateDetails.RateInfos.RateInfo.ChargeableRateInfo['@currencyCode'] );
$(this.RoomRateDetails.RateInfos.RateInfo.RoomGroup.Room).each(function(index) {
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.