Internet Explorer 7 throws jQuery error

15 messages Options
Embed this post
Permalink
Thasmo

Internet Explorer 7 throws jQuery error

Reply Threaded More More options
Print post
Permalink
Hoi!

I'm having problems running Shadowbox in IE7 combined
with jQuery 1.2.6 and the jQuery Adapter for Shadowbox.

Here is my try:

Shadowbox.loadSkin('classic', 'fileadmin/web/scripts/plugins/shadowbox/skin'); // use the "classic" skin
Shadowbox.loadLanguage('de-DE', 'fileadmin/web/scripts/plugins/shadowbox/lang'); // use the English language
Shadowbox.loadPlayer(['img'], 'fileadmin/web/scripts/plugins/shadowbox/player'); // use img viewer

// configure shadowbox
$(document).ready(function() {
       
        if($('a[rel=media]').size() > 0) {
                Shadowbox.init({
                        skipSetup: true
                });
               
                Shadowbox.setup($('a[rel=media]'));
        }
});

The error given by IE7 is:

"Invalid argument. Line: 1121, Sign: 4"

Unfortunately I don't know which file it is,
maybe it's jquery.js or it is the shadowbox.

In FF3 everything works fine.

It would be very nice if someone can help me with this problem!

Thanks!
Wizzud

Re: Internet Explorer 7 throws jQuery error

Reply Threaded More More options
Print post
Permalink
It's more likely to be your link markup that has the problem. Do you have a web-accessible example?
Combine literacy with curiosity and a whole world of information opens up to you
Thasmo

Re: Internet Explorer 7 throws jQuery error

Reply Threaded More More options
Print post
Permalink
Hoi Wizzud!

Sorry for not beeing able to provide an online example.

My Markup beeing XHTML 1.1 is valid on the believe
of the W3C Markup Validation Service.

I created a test case, attached:
IE7 still quits with the error on line 1121, sign 4.shadowbox.htm
(Just replace the IMG src to an existing image.)

I don't get it ...

Thank's so much for help!

PS: IE6 also throws the same error.
Wizzud

Re: Internet Explorer 7 throws jQuery error

Reply Threaded More More options
Print post
Permalink
Sorry, I'm being a bit slow this morning ...
You can't use the Shadowbox load___() functions with DOM Ready! (this post has an explanation of sorts!).
Instead, you should include the necessary language, player and skin files (js and css) directly into the HEAD section.

Combine literacy with curiosity and a whole world of information opens up to you
Thasmo

Re: Internet Explorer 7 throws jQuery error

Reply Threaded More More options
Print post
Permalink
Hello Wizzud!

I'm not using the shadowbox load functions
within the jQuery DOM-ready handler $(document).ready().

At least I think so, if you look at my testcase.

However I now tried to include the JS and CSS
files in the HTML Head via script and link tags manually.

Unfortunately I still get the same
error in Internet Explorer, while FF3 works great.

Thanks very much for your continous help!
Wizzud

Re: Internet Explorer 7 throws jQuery error

Reply Threaded More More options
Print post
Permalink
I didn't say within, I said with! And I did look at your test case.
The post I pointed you to indicates that with or within makes no difference - you still shouldn't use the Shadowbox load__() functions when you are using a DOM Ready capability instead of window.onload.

Can you not go into MS's JIT debugger and at least find out what the breaking line is trying to do, which script it's in, and maybe what the local variables are?
Combine literacy with curiosity and a whole world of information opens up to you
Thasmo

Re: Internet Explorer 7 throws jQuery error

Reply Threaded More More options
Print post
Permalink
Sorry, I knew you did look at my testcase.

I finally uploaded the testcase here:
http://www.mayer-teppich.at/shadowbox/

You can have a look at it there.

Unfortunately I don't get any error anymore
in IE7 at all.

IE6 states:
"Ungültiges Argument" meaning kinda like "Invalid argument"
Line: 1121
Sign: 4

If it's jQuery it is this code:

---
                if ( set )
                        elem[ name ] = value;

                return elem[ name ];
---

Line 1121 is the empty one in between,
so I  guess line 1121 should be the line before -> "elem[ name ] = value;"

But I still don't know where
the problem is. Am I doing something wrong
with calling the shadowbox? =o(
Wizzud

Re: Internet Explorer 7 throws jQuery error

Reply Threaded More More options
Print post
Permalink
In skin.css :

put the border style back into #shadowbox_body, eg

#shadowbox_body {
  ....
  border: 0px none;
}

add a border style to #shadowbox_title, #shadowbox_info, eg

#shadowbox_title, #shadowbox_info {
  ....
  border: 0px none;
}

Combine literacy with curiosity and a whole world of information opens up to you
Thasmo

Re: Internet Explorer 7 throws jQuery error

Reply Threaded More More options
Print post
Permalink
Well, I'm surprised... xD

Thanks very much,
shadowbox is now working in both, IE6 and IE7.

Is the border required?
If yes, why?

Thanks!
Wizzud

Re: Internet Explorer 7 throws jQuery error

Reply Threaded More More options
Print post
Permalink
The border width defaults in IE are "medium", not a pixel number.
Shadowbox parses the border width in order to determine dimensions/positioning, but doesn't check that the parse result isn't NaN (ie. it can only cope with numbers).
[I think that, because the border style is specified in the classic skin, it is sort of assumed that anyone modifying the skin for their own use will change the border style rather than remove it altogether.]

Basically, if zero-width borders are required then they should be set explicitly.

Combine literacy with curiosity and a whole world of information opens up to you
Thasmo

Re: Internet Explorer 7 throws jQuery error

Reply Threaded More More options
Print post
Permalink
Thanks for your explenation and your help! =o)
pmist

Re: Internet Explorer 7 throws jQuery error

Reply Threaded More More options
Print post
Permalink
Hi

This helped me with the same error popping up, however, now i get nothing after the background fades to black.

Any thoughts on why this might be?

my site is http://www.aislezero.co.uk/xindex.php

Thanks
Wizzud

Re: Internet Explorer 7 throws jQuery error

Reply Threaded More More options
Print post
Permalink
I can't see any problem with your site, in either IE7 or FF2.
Combine literacy with curiosity and a whole world of information opens up to you
pmist

Re: Internet Explorer 7 throws jQuery error

Reply Threaded More More options
Print post
Permalink
Ah, I should have mentioned that the problem I'm having is in IE8 Beta, not IE7.

I've noticed that shadowbox doesn't seem to be working anywhere else, on other sites, in IE8 either.

Is there a fix for this?

Thanks
Dave

Re: Internet Explorer 7 throws jQuery error

Reply Threaded More More options
Print post
Permalink
Shadowbox doesn't appear to work in IE8.  I tried it with IE7, it all worked fine.  Hopefully they will fix this before beta is over.  I suggest reporting to Microsoft.