473,401 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Restoring frameset context?

Hello.

I am working on a common problem. . .restoring frameset context when a user
links directly to a page.

Loading the frameset isn't a problem. . .there are numerous examples of
simple Javascript procedures that will do it, like this:

if (top.location.href.indexOf("../index.html") == -1)
top.location.href = "../index.html";

I have that working just fine. However, the frameset displays the default
document in the target frame.

A more complex problem, it seems, is identifying to the frameset which
content the user linked to, and displaying that content in the target frame.
One approach is some fairly complex Javascript that rewrites the frameset,
as shown here:

http://www.webreference.com/js/column36/forcing.html

Is there a simpler way? It would be especially nice if the frameset document
didn't need to know up front the names of all the pages that it might be
called upon to display.

Thanks
-Mark
Jun 8 '06 #1
2 1687
Tom
"Mark" <no****@thanksanyway.org> schreef in
I am working on a common problem. . .restoring frameset context when a
user links directly to a page.

Loading the frameset isn't a problem. ...
A more complex problem, it seems, is identifying to the frameset which
content the user linked to, and displaying that content in the target
frame. One approach is some fairly complex Javascript that rewrites the
frameset, as shown here:

http://www.webreference.com/js/column36/forcing.html

Is there a simpler way? It would be especially nice if the frameset
document didn't need to know up front the names of all the pages that it
might be called upon to display.


Their approach seems a little silly, yes. Would this perhaps be enough (from
http://4umi.com/web/javascript/snips...amerelocator)?

// in each page, somewhere after the <body> opening tag
if( top===self || top.location.hostname !== 'www.mydomain.com' )
document.write( '<a href="http://www.mydomain.com/frame.html?' +
location.href + '">' +
'View this page in its ' + ( top == self ? '' : 'own ' ) +
'frames</a>.' );

// in the frameset, do not omit <noscript><frame
src="default.htm"></noscript>
document.write( '<frame src="' + ( location.search.substring(1) ||
'default.htm' ) + '">' );

It supposedly displays different messages depending on whether the page is
framed by the wrong site or not framed at all. The re-framing is not done
automatically but offered to the user via a normal link. That 's especially
nice I think.
hth
Thomas
Jun 8 '06 #2
"Tom" <no@thank.you> wrote:

Their approach seems a little silly, yes. Would this perhaps be enough
(from http://4umi.com/web/javascript/snips...amerelocator)?


Ok, that is simpler. It still uses the document.write() method, perhaps that
is unavoidable.

So is the following example a standard URI syntax for loading a frameset
(index_frameset.html) and then instructing that frameset to display a
specific document (target_content.html) in a target frame?

http://www.mydomain.com/index_frames...t_content.html

I have tried this syntax in both IE and Firefox, but it doesn't work. Not on
my site anyway.

Thanks
-Mark

Jun 8 '06 #3

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

Similar topics

8
by: Hans | last post by:
Hi There, I have a page that has links with some variables and I need to open the results set in a frameset. I have tried doing this in various different ways, but still cannot get the variable...
1
by: JP | last post by:
Hi, How can I create a dynamic frameset whose content changes based on user inputs? Specifically, how do I toggle a frame within a frameset? How can I allow a user to "close" or "dock" a...
3
by: Jun | last post by:
How can I catch onMouseDown event on a frame/frameset? When I right mouse click at the border area of a frame, I can still get the Window's standard popup menu. How can I catch the mouse click...
6
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
0
by: den 2005 | last post by:
Hi everybody, I am problem with restoring data of byte type to be loaded on an Ink object. The data was earlier converted to byte then finally to hexadecimal data and store on a text file. Is...
1
by: den 2005 | last post by:
Hi everybody, I am problem with restoring data of byte type to be loaded on an Ink object. The data was earlier converted to byte then finally to hexadecimal data and store on a text file. Is...
3
by: William Sullivan | last post by:
Have a frameset HTML page (parent) with child .aspx pages. When each of the child pages loads, it checks to see if the user is authenticated, and if not, redirects to the login page: ...
3
by: mark4asp | last post by:
According to this <http://css-discuss.incutio.com/?page=BoxModelHack> IE6 will display differently to the W3C standard. Only IE6/strict and I suppose IE 7 display correctly. IE 6 transitional and...
12
by: Geoff Cox | last post by:
Hello I'm having a problem loading a frameset file using an include in a php file. Nothing is displayed and when I look at the source code I see that <html> <head> <title></title>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.