Results 1 to 3 of 3

Thread: How to get a popup window using ajax?

  1. #1
    Join Date
    Apr 2008
    Posts
    70

    How to get a popup window using ajax?

    Hi,
    I am working with php website.
    I am not very familiar with ajax but I want a popup window. I want to know is how to get a popup window using ajax? If anyone have the code or please let me guide in a proper direction it will be a great help.
    I want to use popup window with ajax because
    Much quicker to load as it can preload contents.
    The display is really dynamic.

    Thanks in advance.

  2. #2
    Join Date
    May 2008
    Posts
    37

    Re: How to get a popup window using ajax?

    Hey I think this is what you are looking for.

    This taglib lets you define a hyperlink that popups some window with your own HTML/JSP code.

    Code:
    <script language="JavaScript" src="cjajax.js"></script>
    
    <%@ taglib uri="taglib.tld" prefix="ap" %>
    
    What does
    <ap:apopup onMouse="true" url="/servlet/MVC">it mean?</ap:apopup>
    <br>Just click on the link or move your mouse over it.
    Tag lets you request data from server side (attribute url) and display them in the popup window. Attribute urlFunction lets you define a JavaScript function that will construct URL for the request in dynamic.

  3. #3
    Join Date
    Apr 2008
    Posts
    26

    Re: How to get a popup window using ajax?

    Here's the code I recommend:

    Code:
    var newWin = null;
    function popUp(strURL, strType, strHeight, strWidth) {
     if (newWin != null && !newWin.closed)
       newWin.close();
     var strOptions="";
     if (strType=="console")
       strOptions="resizable,height="+
         strHeight+",width="+strWidth;
     if (strType=="fixed")
       strOptions="status,height="+
         strHeight+",width="+strWidth;
     if (strType=="elastic")
       strOptions="toolbar,menubar,scrollbars,"+
         "resizable,location,height="+
         strHeight+",width="+strWidth;
     newWin = window.open(strURL, 'newWin', strOptions);
     newWin.focus();
    }
    To call the function you would use the following code:

    Code:
    <a href="my-pop-up-window.htm"
     onclick="popUp(this.href,'console',400,200);return false;"
     target="_blank">This is my link</a>
    You can put a condition to close the popup too.

Similar Threads

  1. TWebBrowser popup window Problem (Delphi)
    By lucky3664 in forum Software Development
    Replies: 2
    Last Post: 06-03-2012, 11:25 AM
  2. How to Open Popup Window in Javascript?
    By Soumen in forum Software Development
    Replies: 4
    Last Post: 07-02-2010, 04:02 AM
  3. How to open Gmail account in a popup Window?
    By roodiii in forum Technology & Internet
    Replies: 5
    Last Post: 01-02-2010, 01:02 PM
  4. To open a popup window with no toolbar.
    By Zidaan in forum Software Development
    Replies: 2
    Last Post: 06-07-2009, 10:20 PM
  5. Popup a non-resizable window
    By Alexxx in forum Software Development
    Replies: 3
    Last Post: 15-04-2009, 09:26 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,576,623.72540 seconds with 17 queries