-
Notifications
You must be signed in to change notification settings - Fork 5
/
menulist.html
66 lines (63 loc) · 2.73 KB
/
menulist.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<script src="http://www.vhall.com/assets/js/jquery-1.10.2.min.js"></script>
<div><select id="demo16" name="demo16"></select></div>
<input type ='submit' value='commit' id='go'>
<script>
//http://linkagesel.xiaozhong.biz/
$(document).ready(function(){
var data16 = {
1: {gid: 1, value: 'IBM',
sub: {
10: {gid: 10, value: 'X3650'},
11: {gid: 11, value: 'X3860'}
}
},
3: {gid: 3, value: 'HP',
sub: {
20: {gid: 20, value: '360'} ,
21: {gid: 21, value: '380'}
}
},
9: {gid: 9, value: 'DELL',
sub: {
29: {gid: 29, value: 'R710'} ,
30: {gid: 30, value: 'R720'}
}
}
};
var opts = {
data: data16,
select: "[name='demo16']",
dataReader: {id: 'gid', name: 'value', cell: 'sub'}
};
var ls16 = new LinkageSel(opts);
$('#go').click(function(){
console.log($('select').eq(1).val());
});
});
/*
ajax.about from jQuery validation plug-in 1.5.5
http://bassistance.de/jquery-plugins/jquery-plugin-validation/
http://docs.jquery.com/Plugins/Validation
*/
//ajax mode: abort
//usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
//if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
;(function($) {
var ajax = $.ajax;
var pendingRequests = {};
$.ajax = function(settings) {
// create settings for compatibility with ajaxSetup
settings = $.extend(settings, $.extend({}, $.ajaxSettings, settings));
var port = settings.port;
if (settings.mode == "abort") {
if ( pendingRequests[port] ) {
pendingRequests[port].abort();
}
return (pendingRequests[port] = ajax.apply(this, arguments));
}
return ajax.apply(this, arguments);
};
})(jQuery);
</script>
<script src="http://linkagesel.xiaozhong.biz/js/comm.js"></script>
<script src="http://linkagesel.xiaozhong.biz/js/linkagesel-min.js"></script>