So, I've come across this code snippet:
<script language="javascript" type="text/javascript">
<!--
function loadContent(page) {
var request = false;
try {
request = new XMLHttpRequest();
} catch (e) {
try{
request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
alert("Unable to perform the action.");
return false;
}
}
}
request.onreadystatechange = function() {
if(request.readyState == 4) {
if(request.status == 200) {
document.getElementById('content').innerHTML = request.responseText;
}
}
}
request.open("GET", "include.php?page=" + page, true);
request.send(null);
}
//-->
</script>
And then calling it like this:
<a onclick="javascript:loadPage('red_the_clown')"><li>Red</li></a>
<div id="content"><?php include('index2.php'); ?></div>
I've been struggling to figure out how to specifically target a different frame instead of the current one. For example, the #content div will be in _main, but it's being requested from another frame.
Any suggestions or solutions would be greatly appreciated!
Cheers,
Ryan