IE problem with opening Pop up window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Manil
    New Member
    • Mar 2007
    • 8

    IE problem with opening Pop up window

    Hi,

    I am trying to open a pop-up window (once the user clicks on a thumbnail) that is the exact dimension of the larger image. The code behind the page is being generated automatically by DreamWeaver.

    What's confounding me is that the function works in Mozilla but IE complains that there is an error on the page and refuses to open the larger window.

    Here is the code that is in the page-

    Code:
    [HTML]<script type="text/JavaScript">
    <!--
    function MM_openBrWindow(theURL,winName,features) { //v2.0
      window.open(theURL,winName,features);
    }
    //-->
    </script>
    [/HTML]
    To call the function -
    Code:
    [HTML]<area shape="rect" coords="34,59,186,205" href="#" onclick="MM_openBrWindow('images/large/DAISIES.jpg','Daisies','width=500,height=489')" />
    [/HTML]
    Please, let me know if you have any hints/tips on fixing this problem!

    Thanks in advance!!
    Last edited by zmbd; Oct 22 '12, 10:42 AM. Reason: (Acoder)Added code tags (z) tags appeared to have been removed.
  • Dasty
    Recognized Expert New Member
    • Nov 2007
    • 101

    #2
    I am afraid error is somwhere else. The code you have provided seems right.

    Comment

    • Manil
      New Member
      • Mar 2007
      • 8

      #3
      Okay thanks, I will check.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        What does the error message say?

        Comment

        • Rajesh Ghaywat
          New Member
          • Nov 2007
          • 3

          #5
          Go for showModalDialog Box.

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            You mean showModalDialog . That would only work in IE and why use it when window.open() works fine in IE? Maybe if you wanted to show a modal dialog in an intranet user-base where everyone would be using IE, it might be ok.

            Comment

            • Rajesh Ghaywat
              New Member
              • Nov 2007
              • 3

              #7
              Originally posted by acoder
              You mean showModalDialog . That would only work in IE and why use it when window.open() works fine in IE? Maybe if you wanted to show a modal dialog in an intranet user-base where everyone would be using IE, it might be ok.


              Dear acoder,
              You r right that showModalDialog only work in IE, but u may not know that window.open() have a problem. One can open any number of windows by clicking (say on button). Here showModalDialog works fine, only one showModalDialog will open & control is not able to go to calling page until it is open. Its true that showModalDialog does not works in Mozillla(poor browser, headache for programmer), for this check for browser & open showModalDialog or windows accordingly. The code below will definitely help you.

              [CODE=javascript]function OpenPopupWindow s()
              {
              var params = "dialogWidth:40 0px;dialogHeigh t:305px;center: yes;toolbar:no; help:no;status: no;location:no; scroll:no;dialo gLeft:273;dialo gTop:276";
              strURL ="www.google.co m";

              if(window.showM odalDialog)
              {
              window.showModa lDialog(strURL, args,params);
              }
              else
              {
              return window.open(str ,'Windows Name', "height=340,wid th=400,left=270 ,top=260,status =no,toolbar=no, menubar=no,loca tion=no");
              // Some parameters differs thats y written separately.
              }
              }[/CODE]
              Last edited by gits; Jan 31 '08, 06:56 AM. Reason: added code tags

              Comment

              • gits
                Recognized Expert Moderator Expert
                • May 2007
                • 5390

                #8
                Originally posted by Rajesh Ghaywat
                ... Mozillla(poor browser, headache for programmer) ...
                since showModalDialog is not a standards compliant javascript method it is definitly not Mozilla that is to blame here but IE. IE even has its own ECMA-Script implementation called JScript that misses a lot of standards. So not Mozilla is the poor browser ... since IE makes that problems ... all! other browsers have nearly the same behaviour ... but IE has not. it doesn't matter how many additional features a browser has ... in case you use it you have to be aware that it only will work with that specific browser! and as we all know ... html, css, ECMA-script are open standards and why should ONE browser has its own interpetation of all that? ... i don't want to kick off that browser-debate again ... but one thing is for sure: IE causes the headache for the programmer since it misses the idea of standards compliant implementation of common standards!

                kind regards

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  Originally posted by Rajesh Ghaywat
                  You r right that showModalDialog only work in IE, but u may not know that window.open() have a problem. One can open any number of windows by clicking (say on button). Here showModalDialog works fine, only one showModalDialog will open & control is not able to go to calling page until it is open.
                  If the problem is multiple windows, you can name windows and re-use the same window. As for the modal property, it is possible to program this behaviour, though it may not be reliable.

                  One thing I can say is at least your code would work in other browsers. One website I went to depended on showModalDialog as part of the ordering process. They should've known better, so I let them know exactly what I thought.

                  Comment

                  • acoder
                    Recognized Expert MVP
                    • Nov 2006
                    • 16032

                    #10
                    Originally posted by gits
                    one thing is for sure: IE causes the headache for the programmer since it misses the idea of standards compliant implementation of common standards!
                    Not just standards, but accepted implementation that may not form part of any standards, e.g. the humble prompt() method does not work in IE7 (considered as a feature, not a bug).

                    Comment

                    Working...