SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Confirmed Halfwit
    Join Date
    Oct 1999
    Location
    Vancouver, BC, Canada
    Posts
    983
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Is "showModalDialog()" supported by firefox and other browsers?

    Does anyone know if the showModalDialog() javascript function works with firefox or other non-IE browsers?

    I have this code:
    HTML Code:
      args=new Array();
      args["FieldName"] = field_name;
      args["FileURL"] = url;
      args["FileType"] = type;
    
    newURL = showModalDialog( "includes/filebrowser/insimage.php", args, "font-family:Verdana; font-size:12; dialogWidth:475px; dialogHeight:450px; help:no; status:no;");
    But it is not working in firefox. The JavaScript Console on Firefox reports that showModalDialog is not defined.

    Any ideas? Is this not possible? A modification is needed to my javascript code?

    Thanks for any help.
    - A simple online WYSIWYG editor for HTML code snippets.
    - Managed Web Hosting - $3.95/month (resellers welcome)
    - Why pay more? $8.95 domains & $9.95 SSL certificates!

  2. #2
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    No, it is not supported. It's an IE only feature. Check out this link for more information:

    http://blog.davidkaspar.com/archives...and-frames.php
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  3. #3
    Confirmed Halfwit
    Join Date
    Oct 1999
    Location
    Vancouver, BC, Canada
    Posts
    983
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks very much! Do you know what would be the equivalent "cross-browser" javascript code for what I'm trying to do now with the showModalDialog() function? Can I still pass the "arg" array parameter if I use some other cross-browser method?

    Thanks again!
    - A simple online WYSIWYG editor for HTML code snippets.
    - Managed Web Hosting - $3.95/month (resellers welcome)
    - Why pay more? $8.95 domains & $9.95 SSL certificates!

  4. #4
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    The closest thing I could find was this:

    http://jguru.com/faq/view.jsp?EID=331270

    look at the comments at the end.
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,600
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Mozilla based browsers support adding modal=yes to the third argument in a window.open and that will keep the opened window in front of the one that opened it (but doesn't really force it to be modal). There is nothing that will get other browsers to even do this much.

    The solution is to open an overlay in the same window that stops the rest of the page being accessed until it is closed.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Solution for firefox modal window

    here:
    http://artlifenet.blogspot.com

    give some feedback !

    bye

  7. #7
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post

    Hello,

    Here is a cross browser showModalDialog on my blog.
    It works on all major browser.
    window.showModalDialog() - Cross Browser, new version | Development Solutions


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
  •