SO...the following code is stored in an external .js file:
Expand|Select|Wrap|Line Numbers
- //** Heres some AJAX homeboy **\\
- //Hightlights the active tab on the main navigation
- function activeTab(x)
- {
- for (var i=1; i<=9; i++)
- {
- document.getElementById("tab"+x+"_"+i).style.background="#FFFF33";
- document.getElementById("tab"+x+"_"+i).style.color="#34455F";
- }
- }
- function ajaxManager()
- {
- var args = ajaxManager.arguments;
- switch (args[0])
- {
- case "load_page":
- if (document.getElementById) {
- var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
- }
- if (x)
- {
- x.onreadystatechange = function()
- {
- if (x.readyState == 4 && x.status == 200)
- {
- el = document.getElementById(args[2]);
- el.innerHTML = x.responseText;
- }
- }
- x.open("GET", args[1], true);
- x.send(null);
- }
- break;
- case "loadNav":
- ajaxManager('load_page', 'itNav.html', 'loadedNav');
- break;
- case "firstPage":
- ajaxManager('load_page', 'it1.aspx', 'loadedMain');
- break;
- case "secondPage":
- ajaxManager('load_page', 'it2.html', 'loadedMain');
- break;
- case "thirdPage":
- ajaxManager('load_page', 'it3.html', 'loadedMain');
- break;
- case "fourthPage":
- ajaxManager('load_page', 'it4.html', 'loadedMain');
- break;
- }
- }
I then provide links in the left navigation that call the javascript functions as follows:
[HTML]<a href ="javascript:void(0)" onclick="ajaxManager('firstPage')">Sub Navigation1</a>[/HTML]
This all works fine and dandy for the Cases where the 'it2.HTML', 'it3.HTML', and 'it4.HTML' are loaded into <div id="loadedMain"></div>, but the .aspx page in Case "firstPage" does not work.
Please let me know if anything is unclear. I will check this post frequently until the issue is resolved.
Thank you.