PDA

View Full Version : Dynamic Ajax Content - how do I set default page



simcomedia
09-13-2008, 06:15 AM
Dynamic Ajax Content
http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm

I'd like to set one of the pages to load immediately when the page loads. How can I set the code to load say Page A instead of having to select a page as the first item displayed?

ddadmin
09-14-2008, 05:39 AM
Assuming your link to load an ajax content when clicked on looks like this:


<a href="javascript:ajaxpage('test.htm', 'contentarea');">test</a>

To get it to load automatically when the page loads, you'd simply modify the above to:


<script type="text/javascript">

ajaxpage('test.htm', 'contentarea')

</script>

Make sure this script is added after the DIV with the ID "contentarea", not before.

simcomedia
09-16-2008, 06:07 PM
Thanks for the info. Worked like a charm

tinkermob
11-10-2008, 10:01 AM
Thanks from me also. It would be an idea to add this to the example code page.