Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(function () {
- $.ajax({
- url: 'dept3.php'
- , type: 'GET'
- , data: {Sid: $("#Sid").val()}
- , success: function (data) {
- console.log('dept3.php 163');
- // console.log(data);
- var result = JSON.parse(data);
- console.log(result);
- if (result.hasOwnProperty("error")) {
- alert(result.error);
- } else {
- var $m = $("#menu");
- $.each(result.data, function(index, value){
- if (value.parentIsn == -1) {
- $m.append("<li class='isn-"+ value.isn +"' data-isn='" + value.isn + "'><a href='javascript:void(0)'><span>" + value.name + "</span></a><ul></ul></li>");
- } else {
- $('.isn-' + value.parentIsn).children('ul').append("<li class='isn-"+ value.isn +"' data-isn='" + value.isn + "' data-deptisn='" + value.isn + "'><a href='javascript:void(0)'><span>" + value.name + "</span></a><ul></ul></li>");
- }
- });
- $('#menu li li').each(function() {
- if ($(this).children('ul').children().length) {
- var isn = $(this).data('isn');
- var deptisn = $(this).data('deptisn');
- $(this).children('ul').children().first()
- .prepend("<li class='first' data-isn='" + isn + "' data-deptisn='" + deptisn + "'><a href='javascript:void(0)'><span>ะัะต " + $(this).children('a').text() + "</span></a><ul></ul></li>");
- }
- });
- initMenu();
- }
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement