I am creating multiple popup windows for chatting. Now my problem is how to find uniquely from which SendMessage() is called from popup window for sending message to other person. At least how to find the name of pop window.
Please help me so that I can move forward
I am creating multiple popup windows for chatting. Now my problem is how to find uniquely from which SendMessage() is called from popup window for sending message to other person. At least how to find the name of pop window.
Please help me so that I can move forward
Share Improve this question edited Aug 28, 2012 at 12:13 Musa 97.7k17 gold badges122 silver badges143 bronze badges asked Aug 28, 2012 at 12:07 sasi krishnasasi krishna 874 silver badges10 bronze badges 4- Could you please provide more details? The question is quite vague, in my opinion. I'm not even sure what SendMessage() is. ;-) Is it a built in function? Something you wrote? Maybe explain more about what you're hoping to acplish because there might also be a better alternative. – senfo Commented Aug 28, 2012 at 12:10
-
Are you trying to get find out the
name
variable of a previous call towindow.open(name, url [, ...])
? – line-o Commented Aug 28, 2012 at 12:22 -
@line-o it's
(url, name [, ...])
:P – jbabey Commented Aug 28, 2012 at 12:36 - SendMessage() is not a built in function but a user defined method to send msgs using websocket. – sasi krishna Commented Aug 28, 2012 at 12:39
2 Answers
Reset to default 5to just answer your question, it is the name
property the window
object.
window.name
Ex:
var myWindow = window.open('','someName','width=200,height=100');
myWindow.document.write("<p>This window's name is: " + myWindow.name + "</p>");
You can provide your name to the window like this
window.open(URL,name,specs,replace);
myWindow=window.open('','MsgWindow','width=200,height=100');
myWindow.document.write("This window's name is: " + myWindow.name );
Cheers