Is there a way that I could pass a page name as an argument to the index
page at all? Something like
window.location.href='index.html?Loc=IT_Study___In formation.htm';
First: This is one of the biggest reasons frames .... (are not so nice
to use).
But:
If you're stuck without serverside scripting like I was a while ago
trying to get stuff from the request, you could try this (I never put it
to the test for much other purposes than mine, so it may not work in all
situations! And watch out for possible nasty wrapping.):
Your passing the requested file on the URI is OK, then include code
below (pref. as external js) to all the pages that are loaded into the
frame that may have to be reloaded to the actually requested page.
Then in those pages do a test wether request.getParameter("Loc") equals
the filename of the loaded page. If not load the page from
request.getParameter("Loc").
This all ofcourse only when the page is not loaded as the toplevel-page.
I think it will do the trick...
<!-- //start copy code here
function parameterObject(){
qs = top.location.search;
if (qs.length > 1){
qs = unescape(qs.substr(1));
var parameters = qs.split("&");
for(var i=0;i<parameters.length;i++){
splitter = parameters[i].indexOf("=");
if ( (splitter>0) && (splitter<parameters[i].length-1) ){
prop = parameters[i].substr(0, splitter);
val = parameters[i].substr(splitter+1);
// check if property is already there
var testval = eval("this." + prop);
if (typeof testval != "undefined"){
eval("this." + prop + "='" + testval + "," + val + "'");
}else{
eval("this." + prop + "='" + val + "'");
}
}
}
}
}
function getRequestParameter(paramName){
//
return eval("this." + paramName);
}
parameterObject.prototype.getParameter = getRequestParameter;
// initialize var
var request = null;
// instantiate object
request = new parameterObject();
// end copy code here -->
Manno