0

I'm a new user of MVC 3 and this fancybox gives me headache.. During testing in my local computer, it runs well in firefox, chrome and IE even. But after I published it to our test server, it got an error in IE that states : User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB7.0; BTRS102579; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E)

Message: Object expected Line: 1 Char: 1 Code: 0 URI: http://ptywebsite-dev/Scripts/admin.js

Message: Not implemented Line: 146 Char: 427 Code: 0 URI: http://ptywebsite-dev/Scripts/jquery-1.4.4.min.js

I used IE8, jquery.fancybox-1.2.1.js and jquery-1.4.4.min.js.

And below is my script:

<script type="text/javascript">
      $(document).ready(function () {
          /* This is basic - uses default settings */
          $(".single_image").fancybox({
                'padding': 0,
                'type': 'iframe',
                'frameHeight': 279,                
                'centerOnScroll': true,
                'onComplete': function () {
                    $("#fancybox-frame").load(function () { //wait for frame to load and get its height
                        $("#fancybox-content").height($(this).contents().find('body').height() + 30)
                    });
                }
          });
          /* Using custom settings */
          $("a#inline").fancybox({ 'hideOnContentClick': true });
          $("a.group").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': false });

      });
 </script>

Can anyone tell me what I did wrong?

JCandz
  • 1
  • 2
  • http://stackoverflow.com/questions/10140344/jquery-fancybox-trigger-error-on-internet-explorer-8 – Techie Mar 11 '13 at 08:43

1 Answers1

0
$("#fancybox-content").height($(this).contents().find('body').height() + 30)

You don't have a semi-colon to terminate that line. Not sure if that's the problem, but IE 8 and below are very picky about that sort of stuff, so it could be.

When having problems with older versions of IE< it can be useful to run your code through http://www.jshint.com/

joshua.paling
  • 13,762
  • 4
  • 45
  • 60
  • Thanks. Already tried and also checked the commas,syntax and semicolons but still doesn't work.. same error appeared. Message: Object expected Line: 1 Char: 1 Code: 0 URI: http://ptywebsite-dev/Scripts/admin.js was already fixed. It appears that this script was loaded before the jquery source was loaded. But how can I fix this : Message: Not implemented Line: 146 Char: 427 Code: 0 URI: http://ptywebsite-dev/Scripts/jquery-1.4.4.min.js ? Any help is deeply appreciated. :) – JCandz Mar 13 '13 at 03:38