.demo-button{ width:90px; margin-top:20px; padding:15px; font-weight:400; background-color:rgb(175, 66, 107); color:rgba(255, 255, 255, 0.901961); text-decoration:none; text-align:center; text-shadow:rgba(0, 0, 0, 0.701961) 0px -1px 0px; border-radius:3px; box-shadow:rgba(255, 255, 255, 0.0980392) 0px 0px 0px 1px inset, rgba(255, 255, 255, 0.701961) 0px 4px 7px -4px inset, rgba(255, 255, 255, 0) 0px 56px 47px -41px inset, rgba(0, 0, 0, 0.498039) 0px 0px 8px -1px; background-image:linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent); border:0; cursor:pointer } #demo-wrap-content{margin:20px 0px} #demo-wrap{text-align:center}AJAX Archives | Web Tutorial Source
function getDataFile(pageid){ var container = jQuery("#demo-wrap-content"); if(jQuery.isNumeric(pageid)){ container.html("Loading..."); var url = "/assets/tutorials/ajaxwithjavascriptandjquerypart2/data.json"; jQuery.getJSON(url, function (data) { jQuery.each(data.pages, function (index, value) { if(pageid==value.id){container.html(''+ value.title +'
'+ value.content);} }); }); }else{ container.html("Please, if you want to play with the code do it on your machine. Thanks."); } }