codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  how to open instantly a pop up window whenever a user sends a message to the other user  carolnacu at 06:15 on Sunday, August 05, 2007
 

Hi! I'm a junior student at De La Salle University-Manila, and we, our group is having a chat project. We're just new to Java. We decided to place our chat in a jsp page, since we're not using applet, and we still don't know how to use it. The problem is, we don't know how we can notify a user, by opening a pop-up window whenever someone sends a message to him. For example, if I click the username of the person I want to chat with, that person will automatically get a pop-up window (in our case we named our chat window privateChat) displaying the message sent to him. And also, does anyone know how we can display a notification that this particular user has already logged and how he cannot view the pages he has logged out from when he presses the back button? Please, I would very much appreciate any help you can give our group. We're just in a hurry because we have to finish this by next week. Thank you so much in advance!

Carol =)



  Re: how to open instantly a pop up window whenever a user sends a message to the other user  elizas at 12:23 on Monday, February 08, 2010
 

You can open popup window through javascript. But opening it at center of the screen will make it look good for all size of screen.
Following is the way to do it :

This is the link to open popup window
<a href="javascript:void(0);" onclick="popup('http://www.google.com',
'googlePopup',700,600);">OPEN GOOGLE</a>

and the javascript function is

function popup(pageURL, title, popupWidth, popupHeight)
{
var left = (screen.width / 2) - (popupWidth / 2);
var top = (screen.height / 2) - (popupHeight / 2);
var targetPop = window.open(pageURL, title, 'toolbar=no, location=no, directories=no,
status=no, menubar=no, scrollbars=YES, resizable=YES, copyhistory=no, width=' + popupWidth + ',
height=' + popupHeight + ', top=' + top + ', left=' + left);
}
thanks
Eliza
http://www.mindfiresolutions.com/








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  lightweight and heavyweight component
•  array of struct
•  matrix prblm in java
•  Re: how to open instantly a pop up window whenever a user sends a message to the other user
•  Re: PING PROGRAM IN PERL
•  Re: date of birth validation using java script-very urgent
•  JAVA If statements
•  Need Help with a Regular Expression
•  Informations on HTML


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010