31 lines
1 KiB
JavaScript
31 lines
1 KiB
JavaScript
var api_baseurl = "https://api.itbyhf.xyz/v2/Profilpage";
|
|
|
|
|
|
if (page == "blogPost") {
|
|
$.get(api_baseurl+"/pages/all",function(data){
|
|
$.each(data,function(){
|
|
if(this["id"]==getUrlParameter("id")){
|
|
document.getElementById('postTitle').innerHTML=this["title"];
|
|
document.getElementById('postTitle2').innerHTML=this["title"];
|
|
document.getElementById('postSummary').innerHTML=this["summary"];
|
|
document.getElementById('postText').innerHTML=this["text"];
|
|
}
|
|
});
|
|
});
|
|
}
|
|
|
|
var getUrlParameter = function getUrlParameter(sParam) {
|
|
var sPageURL = window.location.search.substring(1),
|
|
sURLVariables = sPageURL.split('&'),
|
|
sParameterName,
|
|
i;
|
|
|
|
for (i = 0; i < sURLVariables.length; i++) {
|
|
sParameterName = sURLVariables[i].split('=');
|
|
|
|
if (sParameterName[0] === sParam) {
|
|
return typeof sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
|
|
}
|
|
}
|
|
return false;
|
|
}; |