function showstories(page) { if(!page) page ='a'; urlc = "?ccat="+page; history.pushState(null, null, urlc); urlx = urlc // url = "./getstories.php?t="+page+"&sid="+sid; $("#mcont").empty(); // console.log(url); // $.getJSON(url,function(res){ // console.log(res); // stories = res; var c = 0; var text = ""; if(!stories.error) { $.each(stories, function(i, field){ console.log("c="+c); otext=field.text; stid = field.sid; tit = field.title; img = field.img; words = field.words; mod = field.mod; hop = field.goto; console.log("hop "+sid+" "+hop); var thispage = field.page; text += "
"; if(page == thispage) { var third = ''; //text="
" + text + "
"; if(thispage != 'n') { if(c == 2) text += "
"; c++; if(c == 3) c=0; third = ' w3-third w3-cell'; } //$("#storyholder").append(text); text +="
" + otext + "
" + otext + "
"; text += "×"; text += mod + "

"; var el = "#mod" + stid; targ = "#story" + stid; urlc = urlx+"&story="+stid; text += ""; } }); text += ""; $("#mcont").append(text); if(story) { targ = "#mod" + story; $(targ).show(); } } else $("#mcont").append(stories.error); // }); } function pushstory(x) { urlc = "?ccat="+page; history.pushState(null, null, urlc); }