javascript - Maintain five section in DOM at a time -
i creating ebook reader, want fetch sections of ebook link : http://tmaserv.scem.uws.edu.au/chapters/?n=0 fetch section number 0 http://tmaserv.scem.uws.edu.au/chapters/?n=1 fetch section number 1 .. on number of sections can obtained url http://tmaserv.scem.uws.edu.au/chapters now, able fetch section, want reader should maintain 5 sections of document in dom @ time.also can fetch 1 section @ time. first 5 fetched document loads,then additional sections fetched on request. code: <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>ebook</title> <script> var requestnum = 0; // assume had fetched number of sections in varibale sectioncount function do_exercise () { var x = new xmlhttprequest(); // adjust url reflect new n value , request before x.open('get', 'http://tmaserv.scem.uws.edu.au/chapters/?n=' + requestnum, true); x.onreadystatechan...