Created
September 16, 2015 11:34
-
-
Save ABooooo/89b9d23810210d4ccc1f to your computer and use it in GitHub Desktop.
get data from json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// check url | |
var url = window.location.pathname; | |
var output = url.indexOf('/events')!=-1; | |
//alert (output[0]); | |
if (output) { | |
(function eventsData() { | |
var flickerAPI = "http://pmone-new.pmone.de/fileadmin/theme/public/json/events.json" | |
$.getJSON( flickerAPI) | |
.done(function( data ) { | |
$('.right').find('> .subBox').eq(0).after('<div class="subBox eventList"></div>'); | |
$.each( data, function( i, item ) { | |
//alert( data.title ); | |
var tblRow = "<p>" + item.title + "</p>" + | |
"<p>" + item.description + "</p>" + "<p>" + item.location + "</p>" + "<p>" + item.url + "</p>"; | |
$(tblRow).appendTo(".right .eventList"); | |
}); | |
}); | |
})(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment