Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    Regular Coder
    Join Date
    Apr 2008
    Posts
    257
    Thanks
    15
    Thanked 0 Times in 0 Posts

    How to make a pop up window?

    hey guys

    how do you make a pop up window that automatically spawns?
    in html?

  • #2
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,179
    Thanks
    174
    Thanked 257 Times in 257 Posts
    well in html it would be like this

    Code:
    <a href="link.html" target="_blank">Link</a>
    in Javascript it would be like this(more control)


    Code:
    <a href="#" onclick="window.open('win1.html','Window1',
    'menubar=no,width=430,height=360,toolbar=no');">Link</a>

  • #3
    Regular Coder
    Join Date
    Apr 2008
    Posts
    257
    Thanks
    15
    Thanked 0 Times in 0 Posts
    is this a pop up that pops up when u visit my homepage?

  • #4
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,179
    Thanks
    174
    Thanked 257 Times in 257 Posts
    Code:
    <script>
    var theURL = 'thePopupPage.html';
    var width  = 300;
    var height = 400;
    
    function popWindow() {
    newWindow = window.open(theURL,'newWindow','toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width='+width+',height='+height);
    }
    </script>
    HTML

    Code:
    <body onload="popWindow()">
    let me know if that what u want!

  • #5
    Regular Coder
    Join Date
    Apr 2008
    Posts
    257
    Thanks
    15
    Thanked 0 Times in 0 Posts
    aww yes thanks a bunch

  • #6
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    Just keep in mind that automatic popups would annoy users and a popup blocker can easily remove them.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #7
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,179
    Thanks
    174
    Thanked 257 Times in 257 Posts
    Just keep in mind that automatic popups would annoy users and a popup blocker can easily remove them.
    Words of wisdom!

    You might want to look into an alternative, but i dont know your situation as far as why it pops up.

  • #8
    Regular Coder
    Join Date
    Apr 2008
    Posts
    257
    Thanks
    15
    Thanked 0 Times in 0 Posts
    i just want a pop up message with updates

    and i can put new updates in there

    and a google Ad

  • #9
    Regular Coder
    Join Date
    Apr 2008
    Posts
    257
    Thanks
    15
    Thanked 0 Times in 0 Posts
    would that work?
    can you put HTML in a pop up

  • #10
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,179
    Thanks
    174
    Thanked 257 Times in 257 Posts
    yes of course. Thats what a pop-up is. Its an html file.

  • #11
    Regular Coder
    Join Date
    Apr 2008
    Posts
    257
    Thanks
    15
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jcdevelopment View Post
    Code:
    <script>
    var theURL = 'thePopupPage.html';
    var width  = 300;
    var height = 400;
    
    function popWindow() {
    newWindow = window.open(theURL,'newWindow','toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width='+width+',height='+height);
    }
    </script>
    HTML

    Code:
    <body onload="popWindow()">
    let me know if that what u want!
    the first one <script> didnt work
    nothing showed up on my browser

  • #12
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You would create a pop-up window manually by using Javascript, Java, and Ajax, along with XHTML to design the ad. There are also software programs you can use to quickly design a pop-up and it automatically generates code.

  • #13
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,179
    Thanks
    174
    Thanked 257 Times in 257 Posts
    Code:
    <script>
    var theURL = 'thePopupPage.html';var width  = 300;
    var height = 400;
    
    function popWindow() {
    newWindow = window.open(theURL,'newWindow','toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width='+width+',height='+height);
    }
    </script>
    on the highlighted area, did you name it your own url? Or did nothing show up at all?

  • #14
    Regular Coder
    Join Date
    Apr 2008
    Posts
    257
    Thanks
    15
    Thanked 0 Times in 0 Posts
    nothing showed up at all
    no pop up window

  • #15
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,179
    Thanks
    174
    Thanked 257 Times in 257 Posts
    show me your cod, exactly as you have it.

    or use this to generate it.. not sure why it wouldnt work http://javascript.internet.com/gener...up-window.html


  •  

    Posting Permissions

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