I'm working on a website which have a treemenu. I've gotten the menu to work alright but I want the DIV which contains the treemenu to have a javascript/ajax which inserts the content of another html file into it. So I don't have to manually edit the code for the menu for each document.
I've put up an Abyss webserver locally here to avoid any issues with the Ajax code.
I've tried using the code found here:
http://www.dhtmlgoodies.com/index.ht...al=ajax-basics
And I basically get an error:
Expand|Select|Wrap|Line Numbers
- Line: 41
- Char: 1
- Error: 'document.getElementById(...)'is null or not an object
- Code: 0
- URL: http://127.0.0.1/mainpage.htm
Expand|Select|Wrap|Line Numbers
- <SCRIPT type="text/javascript">
- ajax_loadContent('dtree','leftmen1.html');
- </SCRIPT>
Anyone?
Edit: I know that it can in fact find the leftmen1.html, cause if I change this to something else (a html file that doesn't excist) then I get no error. And of course no content in the DIV.
I've also tried using the code found here:
http://www.dynamicdrive.com/dynamici...jaxcontent.htm
And with the exact same result..