I'm hoping someone can help me decipher some code I have to force frames into a frameset! I'm fairly new to JavaScript and would appreciate a description of how the different parts of this code work.
Code in the Frameset:
<script language="JavaScript" TYPE="TEXT/JAVASCRIPT">
var inframe = "TRUE";
function lframe(){
var loc = window.location;
loc = loc.toString();
loc = loc.toLowerCase();
if (loc.indexOf("?") > 0) {
var nPage = loc.substring((loc.indexOf("?") + 1), loc.length);
window.mainFrame.location=nPage;
} }
</script>
Code in individual frames:
<script language="JavaScript" TYPE="TEXT/JAVASCRIPT">
if (window.parent.inframe != "TRUE") {
window.parent.location = "index.html?welcome.html" ;
}
</script>
I don't suppose you'd explain to me how these two pieces of script work? (the new version for the frameset and the individual frame script). I currently know very little and am keen to understand as much as I can about what the script does!
Bookmarks