Hi everyone,
So I am completely new to ajax (and not that familiar with JS) and I am struggling a bit trying to implement "tabs" into my project.
I am using the tabs found here (
http://www.dynamicdrive.com/dynamici...tabcontent.htm) with pages loaded through ajax.
the issue I am having is that after the initial load of all the tab content, it seems that any javascript i have in any pages accessed through links (and loaded in the active tab) doesn't seem to be running. the main problem is having a tab with a form in it, and i am trying to submit the form using ajax and then load a confirmation page. i am aware i could be doing this the complete newb way, but being a newb this is a given hehe.
the script i am using to power the tabs is here;
Code:
<script type="text/javascript">
function ahah(url, target) {
document.getElementById(target).innerHTML = ' Fetching data...';
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
if (req != undefined) {
req.onreadystatechange = function() {ahahDone(url, target);};
req.open("GET", url, true);
req.send("");
}
}
function ahahDone(url, target) {
if (req.readyState == 4) { // only if req is "loaded"
if (req.status == 200) { // only if "OK"
document.getElementById(target).innerHTML = req.responseText;
} else {
document.getElementById(target).innerHTML=" AHAH Error:\n"+ req.status + "\n" +req.statusText;
}
}
}
function load(name, div) {
ahah(name,div);
return false;
}</script>
does anybody have any suggestions?
thanks heaps!