| Author |
Opening multiple windows using javascript,is it possible?
|
Jignesh Gohel
Ranch Hand
Joined: Dec 28, 2004
Posts: 276
|
|
Hello , A humble request: Please don't ignore this query due to such a lengthy explaination. I'm making an chat application using JSP & servlets. Now in that my general chat is working fine & now I'm trying to make one-to-one chat. the scenario in my application is : In my application's main page , where i'm doing my General Chat in a particular room say(Room1) , two frames are continuosly getting displayed using the "refresh" property of JavaScript. Now, on the top frame I'm also making the user's name appear who are currently logged in as a HYPERLINK,except the user's name(for e.g. my name). When I click on a particular hyperlinked user,with whom i want to chat ,a window is pop-upped using the javascript function winopen() And this function is called as Now when i am opening my chat application simultaneously in another browser window & some other user logs in the same room & clicks on the hyperlinked username for chatting with him,the same window which got popped-up by the user on the first browser window , the very same window is popped-up again by the user in second browser window. So , is it possible that when i click on a particular hyperlinked user's name a new window can be opened for each username using javascript or using html ??? And if not possible then please suggest me some ideas regarding the same . Thanking you, Jignesh [ April 01, 2005: Message edited by: Bear Bibeault ]
|
Regards,
Jignesh
The Art Of Life Is To Know When To Be Useless And When To Be Useful - CHUANG TZU
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
http://radio.javaranch.com/pascarello/2005/01/19/1106152877000.html Also you may want into XMLHttpRequest to avoid the refreshing.... Eric
|
 |
Senthil B Kumar
Ranch Hand
Joined: Feb 09, 2004
Posts: 140
|
|
|
The first argument to window.open is the window name. Try giving a random text to that window name. so that each time its clicked, a new window is opened.
|
Work like you don't need the money. Love like you've never been hated. Dance like nobody's watching. Sing like nobody's listening. Live like it's Heaven on Earth.
Currently I Reside Here WEBlog
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
The metod with arrays is better since you have control over thw window objects. You can then have a button that closes them all with a click. It is harder to do that with a random parameter. Eric
|
 |
Jignesh Gohel
Ranch Hand
Joined: Dec 28, 2004
Posts: 276
|
|
Hello, Thank you all for your replies. As i said in my query i want to make one-to-one chat module. So when i start chatting with a particular hyperlinked username(as mentioned previously),multiple but having common GUI (for e.g a textfield with a send button & a textarea for displaying sent & receiving messages page) pages for each user should be displayed with whom i(for e.g) want to chat. Thanking you, Jignesh
|
 |
Jignesh Gohel
Ranch Hand
Joined: Dec 28, 2004
Posts: 276
|
|
Sorry, my query was incomplete .I'm very sorry for that. So i would like to ask you that if the above mentioned thing is possible if yes then how to approach & if no then give some suggestions regarding the current mentioned situations. Thanking you Jignesh
|
 |
Yuriy Zilbergleyt
Ranch Hand
Joined: Dec 13, 2004
Posts: 429
|
|
As long as your application can handle the creation of new chatrooms, I don't see the problem. Use the same servlet/JSP page to generate all windows, but pass in parameters so that it knows to create a new room for just the two people chatting. The process of inviting the other person and popping up a window on his end might be tricky, but not all that hard even with refreshing windows. -Yuriy
|
 |
 |
|
|
subject: Opening multiple windows using javascript,is it possible?
|
|
|