Currently I'm working on a local copy of site which uses multi site feature. And there's a strange thing with jQuery script. On main site it works completely correct, but on subdomain the part of this script doesn't work.

For example:


This works great, but this doesn't work:


Here's the console: enter image description here

Here's the function which doesn't work:


function toggle_recurrence_settings () {
    var text = $("#eab-eab-start_recurrence-button").val();
    var alter = $("#eab-eab-start_recurrence-button").attr("data-eab-alter_label");
    $("#eab-eab-start_recurrence-button").attr("data-eab-alter_label", text);
    if (!$("#eab_event-recurring_event").is(":visible")) show_event_recurrence();
    else hide_event_recurrence();
    return false;


What could be the reason of such strange behavior?

  • what is the point of asking a question about your code without showing it? please edit the question and include relevant code Sep 6, 2016 at 14:30
  • The problem is that the code is not mine. It's just a script from plugin. But I will add a part of code which doesn't work to the question. Sep 6, 2016 at 14:38
  • 1
    It would be best to direct this question to the plugin's developer who would be able to give you better support for this scenario. Sep 6, 2016 at 14:42
  • plugin related questions should be asked at their support venues Sep 6, 2016 at 14:43
  • The problem is mostly related to the multisite feature, because on the main domain it works perfectly. Sep 6, 2016 at 14:52

1 Answer 1


The problem was that the function itself was declared before the initialization of button that wasn't working. So the replacing of button init before the function declaration resolved the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.