V
V
Vladimir2017-03-06 12:36:19
JavaScript
Vladimir, 2017-03-06 12:36:19

Why might jQuery not work in Firefox?

Hello. Tell me why the form in Mozilla may not work. Works everywhere. But not in the mozilla.

jQuery(document).ready(function() {
if (jQuery.cookie('less') == null ){
        jQuery.cookie('less', {
            expires: null,
            path: '/',
        });		
  jQuery.fancybox.open({ 
    padding : [0, 0, 50, 0],
      helpers: {
        overlay: {
          locked: false
        }
      },
      wrapCSS : "read-less",
      href: "#read-less"
  });
}

jQuery('.popul_button').click(function () {
    jQuery(this).parents('form').submit();
    });


items:
<input type="radio" class="check" <?=($less["ID"] == $selected_less_id) ? 'checked' : ''?> name="less" id="less_<?=$less["ID"]?>" value="<?=$less["ID"]?>" />

At the exit: when entering the site, a pop-up opens, there are several selection buttons.
Depending on the selected button, the content on the site changes, and the
page is reloaded. In FF, the popup does not appear. You have to click on the link to this
pop-up, an item is selected there, the page reloads, but nothing
else happens.
Fancybox version v2.1.5

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
IgorRastarov, 2017-03-06
Portev @Vladimir Portev

The easiest option in this case is to help jQuery find your Input. And FF swears at the word null. Here's the option that works for me

jQuery(document).ready(function() {
if (jQuery.cookie('less') != "Y" ){  //убираем Null здесь
        jQuery.cookie('less,'Y', {
            path: '/',
        });		
  jQuery.fancybox.open({ 
    padding : [0, 0, 50, 0],
      helpers: {
        overlay: {
          locked: false
        }
      },
      wrapCSS : "read--less",
      href: "#read--less"
  });
}

jQuery('.popul_button').click(function () {
jQuery(this).find('input').prop('checked', true); //нашли верный input И работаем
jQuery(this).parents('form').submit();
    });

I
Ilya Bobkov, 2017-03-06
@heksen

Try installing an older version of jquery.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question