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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    "Best" pop-up code to use?

    Hi all,

    I truely don't like to use pop-up windows and have done very well, to date, not having to do so... but a situation has come up and I will need to use a few on some pages.

    Question:

    Is there a way to code the pop-up in JS but have it still be usefull for those who may have JS turned off? I'm thinking that if the pop-up won't work then a new window would be the next best thing.... If not - what would be a good alternative - maybe another link near by that is a straight link? Is there such a thing as an "html" pop-up (sans JS)?

    If the user has a popup blocker in place - another pitfall to the whole pop-up scheme...

    Anyway - any suggestions would be appreciated.

    TP

  • #2
    New Coder
    Join Date
    Feb 2005
    Posts
    97
    Thanks
    7
    Thanked 7 Times in 7 Posts
    Can you not make the pop ups activated by clicking on a link? As you say a lot of people now have a pop-up blocker of some sort. Pop ups aren't blocked from links and well it's just nice to let the user decide isn't it?

    You will still need JavaScript to customise how you want your popped up windows to display but even those without JS enabled will still be able to access the info, they will just get it in a normal browser screen.

  • #3
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can you not make the pop ups activated by clicking on a link? As you say a lot of people now have a pop-up blocker of some sort. Pop ups aren't blocked from links and well it's just nice to let the user decide isn't it?
    Yes- I'm sorry, I meant to specify that these pop-up windows would be triggered by a link.

    You will still need JavaScript to customise how you want your popped up windows to display but even those without JS enabled will still be able to access the info, they will just get it in a normal browser screen.
    Good - what code will do this? Most of the code I'm finding will not display in a full window when clicked by an agent without JS... ?

    Thanks
    TP

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Code:
    <a href="blah.html" onclick="window.open(this.href,'somename','width=200,height=200,scrollbars=0,menubars=0,toolbars=0,directories=0,status=0');return false" target="_blank">Blah</a>
    Why are the popups so important anyways?

  • #5
    New Coder
    Join Date
    Feb 2005
    Posts
    97
    Thanks
    7
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by Parsed Twice
    Good - what code will do this? Most of the code I'm finding will not display in a full window when clicked by an agent without JS... ?
    I don't think you can. I think most people have JavaScript turned on but what I'm saying is that if you have your script attached to an ordinary link then even those with JS trurned off will still be able to access the information; they will just have to resize/scroll the browser to fit themselves; and well that's their fault

    It seems to me that you are basically going about it the right way.

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Yeah hes wanting a popup code that will work for users with JS enabled but when disabled it will just open the link in a new window. I have provided the code for this.

  • #7
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_
    Code:
    <a href="blah.html" onclick="window.open(this.href,'somename','width=200,height=200,scrollbars=0,menubars=0,toolbars=0,directories=0,status=0');return false" target="_blank">Blah</a>
    Why are the popups so important anyways?

    Excellent! Thank you very much!

    PT

  • #8
    Regular Coder
    Join Date
    Nov 2004
    Location
    The Netherlands
    Posts
    551
    Thanks
    0
    Thanked 0 Times in 0 Posts
    CATdude about IE6: "All your box-model are belong to us"

  • #9
    New Coder
    Join Date
    Jan 2005
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Close This Window?

    Thats great. I was about to post a query regarding this and then found this thread.
    Could you also include the code for a "close this window" link to be placed within the pop up? Thanks

    Paul

  • #10
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    X

    That would be the little button marked "X" found in the top right of the window: works always, is cross-browser and JavaScript independent.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #11
    Regular Coder
    Join Date
    Nov 2004
    Location
    The Netherlands
    Posts
    551
    Thanks
    0
    Thanked 0 Times in 0 Posts
    LOL Indeed, you don't need to provide a close button IMHO, but if you insist:

    <img src="x.gif" alt="" onclick="window.close">
    CATdude about IE6: "All your box-model are belong to us"

  • #12
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Quote Originally Posted by mrruben5
    LOL Indeed, you don't need to provide a close button IMHO, but if you insist:

    <img src="x.gif" alt="" onclick="window.close">
    missing the ()
    Code:
    <img src="x.gif" alt="" onclick="window.close()">
    Of course you can only use a window.close() button if the window was opened using javascript.

  • #13
    New Coder
    Join Date
    Jan 2005
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay okay fair enough.

    On my webpage I am wanting to have several links, the results of which show up in the same pop up window and not in their own independent pop ups if that makes sense.

    Do I use the same code that Aerospace_Eng provided? And also do I just repeat that code for each link and change the link address?

    Thanks
    Paul

  • #14
    New Coder
    Join Date
    Jan 2005
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also....

    when the user goes back to the main page and clicks on a link, can the pop up window "maximise" again with the new content?

    Thanks

    Paul

  • #15
    New Coder mentalhorse's Avatar
    Join Date
    Jul 2005
    Location
    Duanesburg, NY
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i believe to do this you would need to set the target to the same window as before. not as _blank. but as sum other name..
    ie. target="newwindow"


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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