10 examples of 'jquery data selector' in JavaScript

Every line of 'jquery data selector' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
11function jqmDataSelector( expression ) {
12 return "[data-" + $.mobile.ns + expression + "]";
13}
42function toDataSelector(selector) {
43 if (/[\]['"()]/.test(selector))
44 throw new Error("selector is too complex");
45
46 var parts = selector.split(separator_re);
47 var ret = [];
48 for(var i = 0; i < parts.length; ++i) {
49 var part = parts[i];
50 if (part.length) {
51 if (separators.indexOf(part) > -1)
52 ret.push(part);
53 else if (/[a-zA-Z]/.test(part[0])) {
54 part = part.trim();
55 var name_split = part.split(/(.#)/);
56 ret.push(util.classFromOriginalName(name_split[0]));
57 ret = ret.concat(name_split.slice(1));
58 }
59 else
60 ret.push(part);
61 }
62 }
63 return ret.join("");
64}
82function setupSelector(selector) {
83
84 // process new selector value when selector loses focus
85 selector.bind('blur', function(e) {
86 selector.autocomplete('close');
87 });
88
89 // set autocomplete to trigger blur (remove focus)
90 selector.autocomplete({
91 select: function(event, ui) {
92 selector.val(ui.item.value);
93 selector.blur();
94 },
95 delay: 0,
96 minLength: 0
97 });
98
99 // set enter key to trigger blur (remove focus)
100 selector.bind('keypress.enterkey', function(e) {
101 if (e.which === 13) {
102 selector.blur();
103 handleResponse(true);
104 }
105 });
106}
23function $(selector) {
24 return jQuery(selector, element);
25}
14function query(selector, context) {
15 /* jshint -W103 */
16 var ret = root(selector, context);
17 ret._$ = $;
18
19 // We need to remap ourselves to the private context and unfortunately
20 // the return behavior of the Cheerio constructo makes this difficult to
21 // implement without ramapping after the fact.
22 ret.__proto__ = $.fn;
23 return ret;
24}
1244function dataFindAll(node, selector) {
1245 var gui_selector = toGUISelector(selector);
1246 var gui_node = $.data(node, "wed_mirror_node");
1247 var found_nodes = gui_node.querySelectorAll(gui_selector);
1248 var ret = [];
1249 for(var i = 0, found_node; (found_node = found_nodes[i]); ++i)
1250 ret.push($.data(found_node, "wed_mirror_node"));
1251 return ret;
1252}
110$(selector) {
111 return this.$el.find(selector)
112}
4function updateSelect(data, selector, id_attr, value_attr) {
5 var _select_tag = $(selector)[0];
6 var new_options = '';
7
8 // in some cases, e.g. TestRun search, the 1st ';
9 });
10
11 _select_tag.innerHTML = new_options;
12
13 try {
14 $(selector).selectpicker('refresh');
15 } catch(e) {
16 console.warn(e);
17 }
18}
1314function dataFindAll(node, selector) {
1315 var gui_selector = toGUISelector(selector);
1316 var gui_node = $.data(node, "wed_mirror_node");
1317 var found_nodes = gui_node.querySelectorAll(gui_selector);
1318 var ret = [];
1319 for (var i = 0; i < found_nodes.length; ++i) {
1320 ret.push($.data(found_nodes[i], "wed_mirror_node"));
1321 }
1322 return ret;
1323}
218_selector_exists() {
219 return $(this.chart_selector).length > 0;
220}

Related snippets