Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-9614

onclick openpopup returns false gives error on Internet Explorer

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Inactive
    • Affects Version/s: 1.7.2
    • Fix Version/s: None
    • Component/s: Libraries
    • Labels:
      None
    • Environment:
      FC6 with MySQL 5.0, Apache 2.2, PHP 5.2 and Moodle 1.7.2+

      Description

      There's a problem related with Javascript and Internet Explorer 7 (and maybe 6) that affects Moodle 1.7.2
      I'm responsible for several Moodle instalations and version 1.6.4 was ok. After I upgraded to 1.7.2 I received reports that "opening files returns error when using IE". You can see the error in the attachment.

      So, I did tests:

      • Firefox and Opera no problem at all
      • Haven't tested IE6 but got reports saying to have the same problem of IE7 (not sure though)
      • With IE7 I could successfully open JPG, GIF, XML files but couldn't DOC, XLS, PDF, ZIP (didn't try other types)
      • Still, for all file types I was able, with IE7, to right click and: "open in new tab", "open in new window" and "save target" with complete success.

      So, the problem was with onclick that calls javascript function openpopup and I found out from Internet search that there are some issues with IE/XP/Vista. The problem is with "return false" and fixes can be tried with changing it to "return true" or playing with "href=" and avoiding "onclick".

      I have chosen to "return true". The other browsers still behave nicely and IE stops giving error but only displays the window with message "you should receive the document in a new window, if it doesn't....". It doesn't, so people have to click the next link and it works.

      I also tried to put before "return false" the following line
      location.href=fullurl;
      but IE7 gives the download file and also the error .
      Then putting "return true" works fine on IE7 but the problem is that Firefox and Opera do double open: in new window and in current moodle window.....

      so is there better solution?

      Thanks

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                3 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: