Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation HELP: popup window on focus when content changes

    Hi

    first of all sorry if this is posted in the wrong section. I couldn't figure out where else to post this under.

    My problem is that I have a few frames that gets opened with a popup window. Now I would like the popup to come in focus when content changes inside any of the frames. If anyone could help me with this, I would really appreciate it.

    Also when I click on a link in the main window not the popup and it opens in the popup, I want the popup window to come into focus.

    Thanks in advance
    Shaz

  • #2
    Regular Coder
    Join Date
    May 2005
    Location
    Michigan, USA
    Posts
    566
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I assume you are opening the data in the frames from an anchor (<a> tag). What you will need to do is open the the frame in javascript.

    Code:
    //updating frame content
    
    var o = window.open(some_url, frame_target);
    o.focus();
    Note: I do not test code. I just write it off the top of my head. There might be bugs in it! But if any thing I gave you the overall theory of what you need to accomplish. Also there are plenty of other ways to accomplish this same thing. I just gave one example of it. Other ways might be faster and more efficient.

  • #3
    New Coder
    Join Date
    Jan 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi

    Thanks for the reply.


    Yeah you are write I am opening the data inside one of the frames. So as you mentioned, I need to use a function to open the data:

    Could you please implement your code in to this and then I will try if it works and let you know. I couldn't figure out where to put in your code.
    Code:
    function rateSong(song) {
    	var id = "frame1";
    	eval("page" + id + " = window.open('rate.php?song_id=" + song + "', '" + id + "', '');");
    }
    Thanks
    Last edited by iccy; 01-08-2007 at 09:08 PM.

  • #4
    New Coder
    Join Date
    Jan 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can u please help me .
    thanks

  • #5
    New Coder
    Join Date
    Jan 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ????????? I am waiting homie

  • #6
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not sure I fully understand the problem or solution but to implement his change in your code try this.

    Code:
    function rateSong(song) {
      var id = "frame1";
      eval("page" + id + " = window.open('rate.php?song_id=" + song + "', '" + id + "', '');");
      eval("page" + id + ".focus();");
    }
    david_kw

  • #7
    New Coder
    Join Date
    Jan 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks david but I already figured it out since no one helped I tried doing it my way and finally got it the way you mentioned it. thanks though


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •