Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Opening multiple windows using javascript,is it possible?

 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://radio.javaranch.com/pascarello/2005/01/19/1106152877000.html

Also you may want into XMLHttpRequest to avoid the refreshing....

Eric
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic