Axcelcius Posted November 1, 2007 Share Posted November 1, 2007 Here is my code: var page_current = 0; var page_request = false; var page_information = Array(); if(window.XMLHttpRequest){ page_request = new XMLHttpRequest(); }else if (window.ActiveXObject){ try{ page_request = new ActiveXObject("Msxml2.XMLHTTP"); }catch(e){ try{ page_request = new ActiveXObject("Microsoft.XMLHTTP"); }catch(e){} } } function process_page(){ page_current = parseInt(page_current); if(page_information[page_current][5] == 0){ get_page(1); }else{ page_request.open('get', './sources/' + page_information[page_current][5]); page_request.onreadystatechange = function(){ if(page_request.readyState == 4 && page_request.status == 200){ if(page_request.responseText == 1){ document.getElementById("page_errors").innerHTML = null; get_page(1); }else{ document.getElementById("page_errors").innerHTML = page_request.responseText; } } } page_request.send(null); } } function get_page(dir){ page_request.open('get', './sources/' + page_information[page_current][4]); page_request.onreadystatechange = function(){ if(page_request.readyState == 4 && page_request.status == 200){ document.getElementById("menu_item_" + page_current).className = "process_inactive"; page_current = page_current + dir; document.getElementById("menu_item_" + page_current).className = "process_active"; document.getElementById("progress").style.width = ((page_current) / page_information.length * 100) + "%"; document.getElementById("content_header").innerHTML = page_information[page_current][1]; document.getElementById("page_errors").innerHTML = null; document.getElementById("content_layer").innerHTML = page_request.responseText; if(page_information[page_current][3] == 0){ document.getElementById("check_again").className = "hidden"; }else{ document.getElementById("check_again").className = "visible"; } document.getElementById("next_button").value = page_information[page_current][2]; } } page_request.send(null); } What's supposed to happen is when get_page(0) is called to the div content reloads. The problem is that it does not. I don't have any other problems other than that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.