View Full Version : "calling function directly"

11-27-2005, 02:30 PM
Hello again. Using the Dynamic Ajax Content Script (http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm) with lots of pleasure, it simply is great. One problem though, that i seem to be to stupid to resolve.

I would like to have on external page loaded in the container, immediately when the mainpage is shown, and thought it would work as written in the explanations of the script:

You can even load an external page without requiring the click of a link, by calling the function directly:

<script type="text/javascript">
ajaxpage('test.htm', 'rightcolumn') //load "test.htm" into "rightcolumn" DIV

Could somebody explain where i should put that line of code? I have tried in several locations but cannot get it to work .... please, help !

11-27-2005, 04:06 PM
At the bottom of your <body> tag should work nicely.

11-28-2005, 09:17 AM
Yep, as long as that function is called following the container <DIV> within the source (and not before), it should work. If not, the function will try and embed the page while the DIV isn't even loaded yet, and an error will be returned.