Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 5th, 2004, 03:25 PM
Friend of Wrox
 
Join Date: Apr 2004
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default Open framed html and target frame

I have html pages that are run from the local harddrive and interact with a backend SCO Unix server. In some pages I store filenames to be used as bookmarks. Just for reference, here is the code that stores the bookmark...

<script language="JavaScript">
    var totalscore = "0";
    var lesson = "AP_LES";
    var filename = document.location.href;
    filename = filename.substr(filename.lastIndexOf("/") + 1);
    filename = "lessons/ap_les/" + filename;
    SaveLesson(lesson,filename,totalscore);
</script>

I have a link to take the end user back to that bookmark. Unfortunately, the page that is saved is contained within a frameset.
Here is my code that opens up a bookmarked page...

  <script language="JavaScript">
        if (lessonlink == "")
        {
            document.write("Try out our self-paced lessons to get up to speed quickly on your software.");
        }
        else
        {
            document.write(sUser + ", would you like to <a href=javascript:// onclick=window.open(lessonlink)>visit</a> where you last left off?");
        }
</script>

Here is my problem...the page opens just fine using the filename I am saving, but I need it to open up within the main frame of my frameset. Does anyone know how to do this? How can I open up a frame set and target one of the frames with a variable that stores a filename as it opens?

Clay Hess
__________________
Clay Hess
 
Old May 5th, 2004, 04:23 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

var newwin = window.open('yourframeset.html','newwin');

newwin.frames[2].location = 'wherever.html';

I am assuming you have a banner and under it a menu and the main frame. Try this and let me know if it works.

HTH,

Snib

<><
 
Old May 5th, 2004, 04:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

check out http://www.greggriffiths.org/webdev/.../framemanager/ which has some stuff on this.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlink Targeturl to open within the curr frame ismailc XSLT 12 September 11th, 2008 04:52 AM
Transfer value from framed popup to framed mainpag wester Javascript How-To 1 December 27th, 2004 03:56 PM
Window.open from OnClick event in framed env. nancy Javascript How-To 3 December 22nd, 2004 11:30 AM
Target for main frame? Snib Javascript How-To 6 December 13th, 2003 04:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.