js error January 07, 2016, 06:01:34 am version elkarte: 1.0.6Code: [Select](function($){ $(document).ready(function(){ $('.myform select').on("click", function(e){ // ... my code } });})(jQuery);Quotetime: 07.01.2016 12:52:34error: TypeError: o is undefinedfile: http://localhost/elk105/themes/default/scripts/elk_jquery_plugins.jsline: 574
Re: js error Reply #1 – January 07, 2016, 06:20:42 am I edited the message to remove the spoiler tags. One click less to see the errors. I'm not sure what the code is, I guess some code you are using, but the error seems related to Superclick:https://github.com/elkarte/Elkarte/blob/master/themes/default/scripts/elk_jquery_plugins.js#L574I suppose we can see if there is a more recent version of SC available?@Spuds do you know from where did we grab the one we are shipping?
Re: js error Reply #2 – January 07, 2016, 08:32:59 am I think that is the latest version (1.0.0), there has not been an update that I know of. It in the Joels github space along with superfish.I'm not sure why superclick is being called. It would appear that it is being bound to .myform, select from somewhat but is not initiated properly. @inter do you know if you are using .superclick (click to open menus) and if so was the line in theme.js altered at all?
Re: js error Reply #3 – January 07, 2016, 08:41:05 am my full codeSpoiler (click to show/hide)htmlCode: [Select]function elga_show_select_cats(){ global $context, $scripturl, $user_info; echo ' <div class="elga-select-cats"> <form name="elga-cats"> <select> <option value="0">Выберите альбом для перехода</option> </select> </form> </div>';}mymod.jsCode: [Select](function($){ $(document).ready(function(){ var $select = $('div.elga-select-cats form[name="elga-cats"] select'); $select.on("click", function(){ if (this.length === 1 && ( ! arguments.callee.loadCats ) ) { var $first = $select.find(":selected"), selecttext = $first.text(); $first.text('Loading'); arguments.callee.loadCats = 1; $.getJSON(elk_scripturl + "?action=gallery;sa=ajax;m=loadcats", function(data) { data.result.forEach(function(val){ $select.append( $('<option value="' + val.id + '">' + val.name + '</option>') ); }); }) // .done( () => { console.log( "second success" ); } ); // .fail( () => { console.log( "error" ); } ); .always(function() { $first.text(selecttext); }); } }); $select.on("change", function(){ var selval = $select.val(); if (selval > 0) { window.location = elk_scripturl + '?action=gallery;sa=album;id=' + selval; } }); });})(jQuery);
Re: js error Reply #4 – January 07, 2016, 01:32:38 pm Why are you putting code in spoiler tags? We're used to big messages with lots of code. We even like it
Re: js error Reply #6 – January 09, 2016, 03:32:39 am solved: I have been on top of the button with the class:Code: [Select] <ul class="sf-js-enabled sf-arrows"> <li class="listlevel1">i replace:Code: [Select] <ul> <li class="listlevel1">