开发者

jQuery datepicker not working in IE

I have a very basic script that sets up datepicker on three of my inputs, this script works perfect in all browsers apart from Internet Explorer, I just wondered if anyone knew why. This is all of my JavaScript for that page:

<script type='text/javascript'>
    $(function() {
        CKEDITOR.replace('content');
        $('input.datepicker').datepicker();
        $('input[name="media"]').click(function() {
            $('fieldset.media').toggle('slow');
        });
        $('input[name="digital"]').click(function() {
            $('fieldset.digital').toggle('slow');
        });
    });
</script>

The 开发者_Go百科element exists because it works in all other browsers. Firebug (Firefox addon) does not show any errors.

Thanks for any help you can give.

EDIT

This is what my script tag for including jQuery looks like.

<script src='/assets/javascript/jquery.js' type='text/javascript'></script>

EDIT 2

It is working completely (including opacity) in IE6 and IE7, IE8 is not working.


I have fixed it by using individual ID's for each of the elements and changing the conditional comment for Blueprint CSS from this

<!--[if IE]>

To this

<!--[if lt IE 8]>

Hope this helps some people.


I'm just throwing out a guess here, but have you tried putting your code into the .ready() handler? I'm thinking that maybe the reason why your code isn't working is that the document is not fully loaded when the code executes. So, just for kicks, try this:

$(document).ready(function(){ /*your code here*/ });

I am able to use the datepicker control with no problems in IE7 and IE8, but my code is in the .ready handler.

I cannot attest to the functionality in lower versions of IE, but I'd suspect that IE6 would have some issues.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜