开发者

jQuery working in everything but IE7. (checked my commas)

The following code works in IE8, FF, Safari, Chrome etc. (not bothering with IE6 for this one), but doesn't work in IE7. I've been through the code with a fine tooth-comb. Checked the commas, messed around with ; but it's not going anywhere. I'm using the jQuery Validate and Uploadify scripts.

Can anyone see the problem here? Thanks.

    <script type="text/javascript">
        jQuery(document).ready(function($) {

            $("#validateform").validate({
                errorClass: 'invalid',
                rules: {
                    bike_url: {
                        required: true,
                        url: true
                    }
                }   
            })

            $("#uploadify").uploadify({
                'uploader'  : '<?php ech开发者_如何学Co $url . '/wp-content/plugins/biketest/includes/uploadify/uploadify.swf'; ?>',
                'script'    : '<?php echo $url . '/wp-content/plugins/biketest/class/class.uploadify.php'; ?>',
                'folder'    : '<?php echo $url . '/wp-content/plugins/biketest/uploads'; ?>',
                'cancelImg' : '<?php echo $url . '/wp-content/plugins/biketest/includes/uploadify/cancel.png'; ?>',
                'auto'      : true,
                'fileDesc'  : '.jpg or .png files only please.',
                'fileExt'   : '*.jpg;*.jpeg;*.png;',
                'sizeLimit' : '2097152',
                'buttonText': 'Choose Image',
                'scriptData': { 
                    'random': '<?php $rand = rand(0, 999999); echo $rand ?>'
                },
                'onComplete': function(event, queueID, fileObj, response, data) {
                    var image = '<?php echo $rand; ?>-' + ((fileObj.name).toLowerCase()).replace(' ', '');

                    setTimeout(function(){ $(".uploaded").attr('src', '<?php echo $url; ?>/wp-content/plugins/biketest/uploads/s-' + image); }, 500);
                    $("[name=bike_img]").val(image);
                }
            })
        });
    </script>


you need to add some more '...

like this:

$("#validateform").validate({
                'errorClass': 'invalid',
                'rules': {
                    'bike_url': {
                        'required': 'true',
                       'url': 'true'
                    }
                }   
            })

basically every such key/value should be bewteen ''.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜