Xtremer360 Posted December 17, 2008 Share Posted December 17, 2008 I have a function that is supposed to show up when you open the page up in the div=content area but it's not loading the function. I've tried some different things have it hasn't worked however what is supposed to load is what I have for the link that says home in the following code. That part works but not when you first load the page. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Language" content="en-us"> <meta name="language" content="en-us"> <title>Backstage V2 Administration Console</title> <link rel="stylesheet" href="backstage.css" type="text/css" media="screen"> <link rel="stylesheet" href="backstage_print.css" type="text/css" media="print"> <script src="prototype.js" type="text/javascript"></script> <script src="scriptaculous.js" type="text/javascript"></script> <script type="text/javascript" src="ajax.js"></script> </head> <body> <div id=container> <div class=header> <table cellpadding="0" cellspacing="0" border="0" width="95%"> <tr> <td width=110 align=center></td> <td></td> <td width=40% valign=bottom align=right> <a href="#" onclick="ajaxpage('home', 'content'); return false;">Home</a> | <a href="#" onclick="ajaxpage('logout', 'content'); return false;">Logout</a> | <a target="_blank" href="http://kansasoutlawwrestling.com/phpBB3">Forums</a></td> </tr> </table> </div> <div id=container2> <div id=nav> <h1>Character</h1> <ul> <li><a href="#" onclick="ajaxpage('bio', 'content'); return false;">Bio</a></li> <li><a href="#" onclick="ajaxpage('allies', 'content'); return false;">Allies</a></li> <li><a href="#" onclick="ajaxpage('rivals', 'content'); return false;">Rivals</a></li> <li><a href="#" onclick="ajaxpage('quotes', 'content'); return false;">Quotes</a></li> </ul> <h1>Submit</h1> <ul> <li><a href="#" onclick="ajaxpage('roleplay', 'content'); return false;">Roleplay</a></li> <li><a href="#" onclick="ajaxpage('news', 'content'); return false;">News</a></li> <li><a href="#" onclick="ajaxpage('match', 'content'); return false;">Match</a></li> <li><a href="#" onclick="ajaxpage('seg', 'content'); return false;">Seg</a></li> </ul> <h1>Handler</h1> <ul> <li><a href="#" onclick="ajaxpage('directory', 'content'); return false;">Directory</a></li> </ul> <h1>Booking</h1> <ul> <li><a href="#" onclick="ajaxpage('champions', 'content'); return false;">Champions</a></li> <li><a href="#" onclick="ajaxpage('booker', 'content'); return false;">Booker</a></li> <li><a href="#" onclick="ajaxpage('compiler', 'content'); return false;">Compiler</a></li> <li><a href="#" onclick="ajaxpage('archives', 'content'); return false;">Archives</a></li> </ul> <h1>Fed Admin</h1> <ul> <li><a href="#" onclick="ajaxpage('handlers', 'content'); return false;">Handlers</a></li> <li><a href="#" onclick="ajaxpage('characters', 'content'); return false;">Characters</a></li> <li><a href="#" onclick="ajaxpage('applications', 'content'); return false;">Applications</a></li> <li><a href="#" onclick="ajaxpage('eventnames', 'content'); return false;">Event Names</a></li> <li><a href="#" onclick="ajaxpage('titlenames', 'content'); return false;">Title Names</a></li> <li><a href="#" onclick="ajaxpage('matchtypes', 'content'); return false;">Match Types</a></li> <li><a href="#" onclick="ajaxpage('divisions', 'content'); return false;">Divisions</a></li> <li><a href="#" onclick="ajaxpage('countries', 'content'); return false;">Arenas</a></li> </ul> <h1>Site Admin</h1> <ul> <li><a href="#" onclick="ajaxpage('templates', 'content'); return false;">Templates</a></li> <li><a href="#" onclick="ajaxpage('content', 'content'); return false;">Content</a></li> <li><a href="#" onclick="ajaxpage('biosconfig', 'content'); return false;">Bio Configuration</a></li> <li><a href="#" onclick="ajaxpage('newscat', 'content'); return false;">News Categories</a></li> <li><a href="#" onclick="ajaxpage('menus', 'content'); return false;">Menus</a></li> </ul> </div> <div id=content> </div> <div id="footer">Backstage 1 © 2009</div> </div> </div> </div> </body> </html> Link to comment https://forums.phpfreaks.com/topic/137310-solved-immediate-page-doenst-load/ Share on other sites More sharing options...
haku Posted December 17, 2008 Share Posted December 17, 2008 What? ??? Link to comment https://forums.phpfreaks.com/topic/137310-solved-immediate-page-doenst-load/#findComment-717449 Share on other sites More sharing options...
Xtremer360 Posted December 17, 2008 Author Share Posted December 17, 2008 The script is found at kansasoutlawwrestling.com/other/backstage.php If you notice nothing loads in the middle content area. However when you look at the top of the window and see Home and click on it the content that it loads into the content box is whats supposed to load up when you open the script. I want to know what tag I'm supposed to enter between my <div id=content> and </div> tags so that it will load that content. What? ??? Link to comment https://forums.phpfreaks.com/topic/137310-solved-immediate-page-doenst-load/#findComment-717451 Share on other sites More sharing options...
PC Nerd Posted December 17, 2008 Share Posted December 17, 2008 Ok, I think - what your saying is that you can load content already and it all works, but you want to be able to load default page? Yes? Well Ill assume thats right. What you want to do is in the <head> section of your page: ajaxpage("default", "content"); however - that means that every time a user refreshes their browser, it will show them the default home page. instead ( I cant remember hte java script code for cookies but check out w3schools.org for that) - set a cookie each time you load a page. the cookie contains the page name that is currently loaded into your content area.... then change the <head> script so that it checks for a cookie - if there is one loads that page, and if there isnt ( assume is a new visitor) and then display the default page with the above code. Im assuming that your page names are loaded through either ajax of php backend - but I think you get the idea. *** You could also just put the home/default page into your content area, and then just go document.getElementById('Content').innerHTML = NEW_PAGE;, but Im assuming that your trying to seperate content from template/design on your code so if that is the case - the above methods shoudl work better for your case. Good luck PC_Nerd Link to comment https://forums.phpfreaks.com/topic/137310-solved-immediate-page-doenst-load/#findComment-717470 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.