...

View Full Version : HELP: popup window on focus when content changes



iccy
01-08-2007, 03:30 AM
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:)

SpirtOfGrandeur
01-08-2007, 09:03 AM
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.



//updating frame content

var o = window.open(some_url, frame_target);
o.focus();

iccy
01-08-2007, 09:14 PM
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.


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


Thanks

iccy
01-09-2007, 08:39 AM
can u please help me :o .
thanks

iccy
01-10-2007, 08:45 AM
????????? I am waiting homie

david_kw
01-10-2007, 10:03 AM
I'm not sure I fully understand the problem or solution but to implement his change in your code try this.



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


david_kw

iccy
01-10-2007, 09:20 PM
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 :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum