runninghorse Posted April 15, 2004 Share Posted April 15, 2004 I'm working with someone who has a customer who wants a popup window to open on their main page... (I know I know, but anyway...) ... Problem is, the page is in frames, so there's a menu frame on the left and a main frame on the right. I've got the popup window working (code is installed in the main page, so it doesn't open every time you view the menu), but the popup is supposed to say something like "Check out the new community" and then link to that community page... Well for the life of me, I can't get it to open back into the frameset. I can either get it to open the page in the popup window itself, OR in a new window, neither of which will work... Here's my code: Code in head tag: ><script LANGUAGE="JavaScript"> <!-- Idea by: Nic Wolfe (Nic@TimelapseProductions.com) --> <!-- Web URL: http://fineline.xs.mw --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin function popUp(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=0,width=350,hei ht=400,left = 525,top = 375');"); } // End --> </script> Code in body tag: ><body onLoad="javascript:popUp('popup.html')"> Thanks tons! Ramsey Quote Link to comment Share on other sites More sharing options...
kaseytraeger Posted April 15, 2004 Share Posted April 15, 2004 Hi Ramsey, I haven't coded too much in JavaScript, but I have in other languages, so bear in mind that what I'm saying isn't language-specific. I'm not sure if the problem lies in your pop-up script. It seems to me like the problem is happening with the content of the pop-up window. When the pop-up window appears, it says "Check out the new community" -- which I presume is a link to the community page that you want to load into the non-navigational frame. To do this, make sure that the frame has a unique name/id, and that the window it sits in (that contains both the navigation frame and the content frame) has a name. Then you set your link in the pop-up window to go to the window with the specific name you've chosen (e.g., "main window") and appear in the frame that's supposed to contain content (e.g., "contentframe" versus "navigationframe"). Let me do a bit more research, but I think that will work for you. Quote Link to comment Share on other sites More sharing options...
runninghorse Posted April 15, 2004 Author Share Posted April 15, 2004 Thanks Kasey, I thought that might be it, just simply coding the link like you would with any other frameset type of page, but I just can't seem to get it to work. Maybe I have the wrong 'names' for these frames. *sigh* I hate working on stuff that other people have designed -- especially when it's not that great to begin with! Quote Link to comment Share on other sites More sharing options...
btrfld Posted April 15, 2004 Share Posted April 15, 2004 Hi Ramsey. Here's a page with an example of what they call a 'Control Panel'; loading a parent window by an action in its child window. Javascript Quickstart In the second script on the page, you'll find this: function updateParent(newURL) { opener.document.location = newURL } I think that by substituting "opener.frameName.document.location" for "opener.document.location" you can get it to address the Frame rather than the parent window. At least it's a place to start. I hope it leads you to something useful. Jim Quote Link to comment Share on other sites More sharing options...
Alan Posted April 17, 2004 Share Posted April 17, 2004 runninghorse, If I understand you correctly " your trying to get the link in the popup to open in a frame which is inside the page that opened the popup. >> The reason your not getting it to work right, is because you are trying to open it in a frame that is not there. When you try to open the link in the frame: "Something" it trys to open it in that popup window, and there is no frame "Something" You might try linking the link and making the link open in: "http://domain.com/frame-page.ext" Not sure if this will work, but if I understand your question it should. Quote Link to comment Share on other sites More sharing options...
greatfolios sysop Posted April 17, 2004 Share Posted April 17, 2004 I think that a target="parent" may help. take a look here http://cas.uah.edu/whittena/mis114/frames/parent1b.html and see if that gets it. Good luck. Mr. Bill :Nerd: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.