Results 1 to 4 of 4

Thread: how to open pop-up window

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    11

    how to open pop-up window

    hi everybody,

    i wan't to open a pop-up window from existing page with a link given in anchor tag. The link is like this example: www.google.com. If i'am clicking the link a new pop-up window with www.google.com must open. i'am using javascript for this. please help me in this issue.

    thanx
    kishore

  2. #2
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: how to open pop-up window

    First off, this post should be in XML, HTML, Javascript, Web and CGI.

    Second, I'll try to answer. You can use the target attribute in html having something like <a href="http://google.com" target="google">google</a>. If you really want to use javascript, open function in a window object covers, i guess. <a href="" onclick="window.open('http://google.com');">google</a>

  3. #3
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: how to open pop-up window

    Quote Originally Posted by nebulom
    First off, this post should be in XML, HTML, Javascript, Web and CGI
    Moved
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    Re: how to open pop-up window

    If you want to use JavaScript outside of the HTML tags, you can make the JavaScript code block in the HEAD section of your HTML code and do this:

    Code:
    <script language="javascript">
    function pop_up()
    {
         window.open("http://www.google.com", "", attributes);
    }
    </script>
    You can then do this in the HTML code:

    Code:
    <a href="" onclick="javascript:pop_up()">www.google.com</a>
    Here are some attributes that you an use for the window.open() method:

    width - width of the pop-up window

    height - height of the pop-up window

    location - Shows the address bar in the pop-up window (set to true or false)

    menubar - Shows the menu bar in the pop-up window (set to true or false)

    resizeable - Enables or disables manual resizing of the pop-up window (set to true or false)

    scrollbars - Enables or disables the scrollbars (set to true or false)

    status - Enables or disables the status bar (set to true or false)

    titlebar - Enables or disables the titlebar (set to true or false)

    toolbar - Enables or disables the toolbar (set to true or false)

    This seems like a lot but it gives you full control over how the pop-up window appears.
    Last edited by GamerMax5; Aug 5th, 2005 at 02:39 PM.
    Only those who try will become.

    Find me on identi.ca

    Twitter @gfmartin05

    Linux Wrap

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width