Error starting jQuery + Fancybox in Internet Explorer 8

I have this jQuery code on my page that works fine in Chrome, but I get an error in Internet Explorer 8 in the trigger line ('click')

$('#btnd16').click(function(e){
    var iiid = $('#midet').val();
    $('#d16_midethistorial_id').val(iiid);

    //sumamos por ajax
    var $mivalor = $('#d16_midethistorial_id').val() 
    var $url = $('input#miruta').val(); 

    $.post($url, { midethistorial_id: $mivalor }, 
        function(data) { 
                $("#nirefancy").fancybox({
                'width'         : '90%',
                'height'    : '90%',
                'transitionIn'  : 'elastic',
                'transitionOut' : 'elastic',
                'type'      :'inline',
                'autoDimensions': false,
                'autoScale' : false,
                        'scrolling' : 'no',
                'titleShow' : true,
            }).trigger('click');
    });

    return false
});

This is my html for fancybox:

<a href="{{ path('detformacion_play',{'id': detentrenamiento.detformacion.id }) }}"  id="nirefancy" style="display: none;">.</a>

I clicked on the butten and I paste some data via ajax into the database, after which I want to open fancybox. As I said, it works on Chrome, but not in IE8

any help or hint? thanks in advance

+3
source share
1 answer

Above my head, two possibilities:

1) 'titleShow' : true,<- the extra comma at the end of the object IE interprets as Satan

2) Turn on the event handler in the finished document block:

$(document).ready(function () {
    $('#btnd16').click(function (e) {
    ...
});
+5
source

All Articles