Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery plugin not working in Facebook static HTML tab
    primarykey
    data
    text
    <p>For a facebook fan page I have created a static html tab (<a href="https://www.facebook.com/jgsportevents/app_190322544333196" rel="nofollow">https://www.facebook.com/jgsportevents/app_190322544333196</a>), where I would like to use the chained jquery plugin just like I did on the client's website (<a href="http://tinyurl.com/c3bfz93" rel="nofollow">http://tinyurl.com/c3bfz93</a>). The Chained plugin is located in the tab's basic script.js and looks like this:</p> <pre><code>(function($) { $.fn.chained = function(parent_selector, options) { return this.each(function() { /* Save this to self because this changes when scope changes. */ var self = this; var backup = $(self).clone(); /* Handles maximum two parents now. */ $(parent_selector).each(function() { $(this).bind("change", function() { $(self).html(backup.html()); /* If multiple parents build classname like foo\bar. */ var selected = ""; $(parent_selector).each(function() { selected += "\\" + $(":selected", this).val(); }); selected = selected.substr(1); /* Also check for first parent without subclassing. */ /* TODO: This should be dynamic and check for each parent */ /* without subclassing. */ var first = $(parent_selector).first(); var selected_first = $(":selected", first).val(); $("option", self).each(function() { /* Remove unneeded items but save the default value. */ if (!$(this).hasClass(selected) &amp;&amp; !$(this).hasClass(selected_first) &amp;&amp; $(this).val() !== "") { $(this).remove(); } }); /* If we have only the default value disable select. */ if (1 == $("option", self).size() &amp;&amp; $(self).val() === "") { $(self).attr("disabled", "disabled"); } else { $(self).removeAttr("disabled"); } $(self).trigger("change"); }); /* Force IE to see something selected on first page load, */ /* unless something is already selected */ if ( !$("option:selected", this).length ) { $("option", this).first().attr("selected", "selected"); } /* Force updating the children. */ $(this).trigger("change"); }); }); }; /* Alias for those who like to use more English like syntax. */ $.fn.chainedTo = $.fn.chained; })(jQuery); $("#bestemming").chained("#sport"); /* or $("#series").chainedTo("#mark"); */// Javascript Document </code></pre> <p>Furthermore I am calling the tab's script page with [[script.js]] in the tab's index.html file, and jquery with http://code.jquery.com/jquery-latest.min.js'> . Unfortunately I can't get the plugin to work like it does on my client's website.</p> <p>What is going wrong?</p> <p><strong>Update</strong></p> <p>Based on Fabio Antunes' answer I have changed the code. Unfortunately its still not working. I've changed the code but still no effect. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload