PDA

View Full Version : Default page for ajax menu


futureproof
04-28-2010, 07:18 AM
Hi guys,

I have an ajax navigation where the main content window loads whatever you tell it to via menu buttons. Heres the code:

<li>
<a class="first" href="javascript:ajaxpage('main/php/index.php', 'dynamic', assignTooltips);">News</a>
<a class="last" href="javascript:ajaxpage('main/php/news.php', 'dynamic', assignTooltips);">News2</a>
</li>

When you click on a button, it loads the php file in the content container. What I'm looking for is a way to have one of the two options already loaded by default when the user access the page. Is this possible?

I've tried including the php file via "include" and that works (but not as part of the ajax navigation, which appears below it on-click)

futureproof
04-30-2010, 08:10 PM
if anyone is interested, I figured it out:thumbsup:

<!-- Default page load -->
<script type="text/javascript">
ajaxpage('main/php/index.php', 'dynamic', assignTooltips);
</script>

Simply (Doh) you take the script out of the a href tags and put it in the main body of index.html (or whatever homepage you want to autoload from )