473,695 Members | 2,622 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to force a child window to open in its frame set

how do I force a window, pened alone, to be displayed in its frame set?

tried this:

if (parent.locatio n.href == self.location.h ref) {
window.location .href = '../';
}

the problem is that the original page is replaced by the main.htm page (the
default page for the 'main' frame)., because the open event of the menu page
calls for the main.htm to be loaded.
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.ht ml?Loc=IT_Study ___Information. htm';
TIA
BTW the web site is: http://uk.geocities.com/philippeoget/a2z/
Phil
Jul 23 '05 #1
3 2710
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.ht ml?Loc=IT_Study ___Information. 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.getPara meter("Loc") equals
the filename of the loaded page. If not load the page from
request.getPara meter("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.se arch;
if (qs.length > 1){
qs = unescape(qs.sub str(1));
var parameters = qs.split("&");
for(var i=0;i<parameter s.length;i++){
splitter = parameters[i].indexOf("=");
if ( (splitter>0) && (splitter<param eters[i].length-1) ){
prop = parameters[i].substr(0, splitter);
val = parameters[i].substr(splitte r+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 getRequestParam eter(paramName) {
//
return eval("this." + paramName);
}
parameterObject .prototype.getP arameter = getRequestParam eter;

// initialize var
var request = null;
// instantiate object
request = new parameterObject ();
// end copy code here -->

Manno
Jul 23 '05 #2
In article <f6************ **************@ posting.google. com>,
ph**********@ya hoo.com enlightened us with...
how do I force a window, pened alone, to be displayed in its frame set?
the problem is that the original page is replaced by the main.htm page (the
default page for the 'main' frame)., because the open event of the menu page
calls for the main.htm to be loaded.
Is there a way that I could pass a page name as an argument to the index
page at all?


Got server-side scripting?
It's a lot easier that way.

I have a dynamic frameset in JSP that does this exact thing.
--
--
~kaeli~
The definition of a will?... (It's a dead giveaway.)
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3
manno wrote:
function parameterObject (){
This is used as a constructor, so

function ParameterObject ()
{

is better (to distinguish it from methods).
qs = top.location.se arch;
You should care to check before you lookup:

<http://pointedears.de. vu/scripts/test/whatami>
if (qs.length > 1){
qs = unescape(qs.sub str(1));
var parameters = qs.split("&");
I've learned that you should also split at ";":

var parameters = qs.split(/[&;]/);
for(var i=0;i<parameter s.length;i++){
Looking up again and again is inefficient:

for(var i = 0, len = parameters.leng th, splitter, testval;
i < len;
i++)
{
splitter = parameters[i].indexOf("="); ^^^^^^^^

No reason to define undeclared globals. Declare your variables, see above.
if ( (splitter>0) && (splitter<param eters[i].length-1) ){
prop = parameters[i].substr(0, splitter); ^^^^ global
val = parameters[i].substr(splitte r+1);
// check if property is already there
var testval = eval("this." + prop);
Yuck! There is exactly no reason for using evil eval() here:

<http://jibbering.com/faq/#FAQ4_40>
if (typeof testval != "undefined" ){
Accessing

// corrected the previous statement;
// note that "testval" is declared (local)
// in the "for" statement
testval = this[prop];

already yields a warning, so you should write

if (typeof this[prop] != "undefined" )
{
testval = this[prop];

eval("this." + prop + "='" + testval + "," + val + "'");
this[prop] = testval + "," val;
}else{
eval("this." + prop + "='" + val + "'");
this[prop] = val;
}
}
}
}
}
function getRequestParam eter(paramName) {
//
return eval("this." + paramName);
return this[paramName];
}
parameterObject .prototype.getP arameter = getRequestParam eter;

// initialize var
var request = null;
Nonsense.
// instantiate object
request = new parameterObject ();


var request = new ParameterObject ();
PointedEars
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1779
by: | last post by:
In IE, from the child window of a frameset i use the function top.window.close() And this works in IE, but not in nn4! How can i make this same effect in nn4? please help
2
7627
by: Richard Bell | last post by:
I'm a bit new to Javascript and am trying to do oNewWin = window.open( ... ); then determine when the contents of oNewWin are completely loaded. I've tried oNewWin.attachEvent( "onload", myfunc);
2
2441
by: John Dalberg | last post by:
I have a closed box system which opens an html page. The page closes by the system. I have access to the html page. I added code to open a child window from this page. However when the parent window closes, the child closes too. Is there a way to keep the child window open? Yes keep it orphaned. -- John Dalberg
10
4304
by: CyberBless | last post by:
I have a page that opens a child window using window.open(...). How do I make so that when that child window opens you cannot get the focus back on the parent window unless you close the child window? Is it even possible?
2
23501
by: Raj | last post by:
Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence of events are 1) I click a button in the parent window to open a child window thru javascript window.open 2) I have some functionality in the child window that changes the data
6
2068
by: SAL | last post by:
Hi, VS2005 post I'm opening a window using the following syntax: Protected Sub lbEstValue_Click(ByVal sender As Object, ByVal e As System.EventArgs) Response.Write("<script>window.open('EstValueHelp.aspx','_help', 'width=400,height=400');</script>") End Sub
1
2623
by: btreddy | last post by:
Hii all.., I have one query not able to find a solution. I've one javascript page(parent)on which upon clicking one link it willopen one more page(child page). here my question is how to set the value for a variable, which is there in the child window,once the user clicks on the link in parent window. I tried this.
0
9126
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8861
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7673
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6500
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5841
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3021
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2283
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1984
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.