<link rel="shortcut icon" href="https://cdn0.iconfinder.com/data/icons/star-wars/512/death_star-128.png" type="image/png">
<meta property="og:image" content="http://mega-mind.info/stories/img/story.jpg" />
var name = '<?php echo $_GET['name']; ?>';
var gender = '<?php echo $_GET['gender']; ?>';
var story = '<?php echo $_GET['story']; ?>';
<html>
-тэг пропущен<?=$_GET['name']?>
и <?=$_GET['story']?>
куда нужно...var dark = false;
function KlickMoon() {
document.body.style.background = dark ? 'rgb(255, 255, 255)' : 'rgb(23, 23, 23)';
dark = !dark;
}
var colors = [
'rgb(22, 22, 22)',
'rgb(88, 88, 88)',
'rgb(200, 200, 200)',
'rgb(255, 255, 255)'
];
var color_index = 0;
function KlickMoon() {
document.body.style.background = colors[color_index++];
if(color_index == colors.length)
color_index = 0;
}
function sortDate(a,b){
var aDate = new Date(a.createdAt);
var bDate = new Date(b.createdAt);
if(aDate == bDate)
return 0;
if(aDate < bDate)
return -1;
if(aDate > bDate)
return 1;
};
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "https://api.parse.com/1/classes/Blog", true);
xmlhttp.setRequestHeader('Content-Type', 'application/json');
xmlhttp.setRequestHeader('X-Parse-Application-Id', 'GKid48BAvytRnKn8Y8CFKiKQ8jIJSYwpUsr1vID1');
xmlhttp.setRequestHeader('X-Parse-REST-API-Key', '6bnW8hVQNvuLQYiDiXvMHwIvV0inEne93gLzOC0A');
xmlhttp.onload = function () {
if (xmlhttp.status === 200) {
var userInfo = JSON.parse(this.responseText);
console.log(this.responseText);
debugger;
userInfo.results = userInfo.results.sort( sortDate );
var arr = userInfo.results.reverse();
var text = "";
for (var i = 0; i < arr.length; i++) {
text += '<div class="blog-post"><div class="blog-header">'+arr[i].title + '</div><br><img width="560px;" src="' + arr[i].img + '"><br><div class="blog-text">' + arr[i].text + '</div><div class="blog-share"><a href="http://gamer-by-life.com/share/?title='+arr[i].title + '&text='+arr[i].text + '&img='+arr[i].img + '&time='+arr[i].createdAt + '"><img src="share.png"></a></div><br></div><br>\n';
}
console.log(text);
}
};
xmlhttp.send();