I found an error in javascript of staff online widget can someone help me to solve it?
This is a Hitskin.com skin preview
Install the skin • Return to the skin page
This is a Hitskin.com skin preview
Install the skin • Return to the skin page
div id="Staff_Online">
</div>
<script type="text/javascript">
jQuery(document).ready(function () {
var widget = jQuery('#Staff_Online')[0];
staff_cache_time = 4*60*1000; // mm*ss*ms;
if (localStorage.staffOn && localStorage.staffEx > +new Date - staff_cache_time) {
jQuery(widget).html(localStorage.staffOn)
} else {
jQuery.get('/viewonline', function (data) {
var group = {
ffnd: jQuery('.table span[style="color:#990012"]', data).parents('td'),
adm: jQuery('.table span[style="color:#FF0000"]', data).parents('td'),
gmod: jQuery('.table span[style="color:#800080"]', data).parents('td'),
fmod: jQuery('.table span[style="color:#7057FA"]', data).parents('td'),
tsup: jQuery('.table span[style="color:#0020C2"]', data).parents('td'),
smod: jQuery('.table span[style="color:#008000"]', data).parents('td'),
}; jQuery(widget).append(group.ffnd).append(group.adm).append(group.gmod).append(group.fmod).append(group.tsup).append(group.smod);
jQuery('#Staff_Online a[href^="/u"]').each(function () {
var prof = jQuery(this).attr('href');
jQuery('<a href="' + prof + '" class="avatarimage"></a>').insertBefore(this);
jQuery('<div class="Info"></div>').insertAfter(this);
jQuery(this).prev().load(prof + ' #profile-advanced-right .main-content img:eq(0)');
jQuery(this).next().load(prof + ' #field_id5 dd div:eq(0)')
})
});
jQuery(window).on('load', function () {
localStorage.staffOn = document.getElementById(widget).innerHTML;
localStorage.staffEx = +new Date;
})
}
});
</script> <style>
#Staff_Online .avatarimage > img {
float: left;
margin-right: 4px!important;
width: 40px;
height: 40px;
border: 1px solid #0000CD;
border-radius: 4px;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1);
}
#Staff_Online .Info {
color: darkgray;
margin: 1px 45px;
padding: 10px 0px 10px;
width: 190px;
display: table-cell;
}
#Staff_Online {
height: auto;
}
#Staff_Online td {
display: block;
}
</style>
<div id="Staff_Online"></div>
<script type="text/javascript">
jQuery(document).ready(function() {
var oWidget = jQuery('#Staff_Online');
staff_cache_time = 4 * 60 * 1000; // mm*ss*ms;
if (localStorage.staffOn && localStorage.staffEx > +new Date - staff_cache_time) {
oWidget.html(localStorage.staffOn)
} else {
jQuery.get('/viewonline', function(data) {
var group = {
ffnd: jQuery('.table span[style="color:#990012"]', data).parents('td'),
adm: jQuery('.table span[style="color:#FF0000"]', data).parents('td'),
gmod: jQuery('.table span[style="color:#800080"]', data).parents('td'),
fmod: jQuery('.table span[style="color:#7057FA"]', data).parents('td'),
tsup: jQuery('.table span[style="color:#0020C2"]', data).parents('td'),
smod: jQuery('.table span[style="color:#008000"]', data).parents('td'),
};
oWidget.append(group.ffnd).append(group.adm).append(group.gmod).append(group.fmod).append(group.tsup).append(group.smod);
oWidget.find('a[href^="/u"]').each(function() {
var prof = jQuery(this).attr('href');
jQuery('<a href="' + prof + '" class="avatarimage"></a>').insertBefore(this);
jQuery('<div class="Info"></div>').insertAfter(this);
jQuery(this).prev().load(prof + ' #profile-advanced-right .main-content img:eq(0)');
jQuery(this).next().load(prof + ' #field_id5 dd div:eq(0)')
})
});
jQuery(window).on('load', function() {
localStorage.staffOn = document.getElementById('Staff_Online').innerHTML;
localStorage.staffEx = +new Date;
})
}
});
</script>
<style>
#Staff_Online .avatarimage > img {
float: left;
margin-right: 4px!important;
width: 40px;
height: 40px;
border: 1px solid #0000CD;
border-radius: 4px;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1);
}
#Staff_Online .Info {
color: darkgray;
margin: 1px 45px;
padding: 10px 0px 10px;
width: 190px;
display: table-cell;
}
#Staff_Online {
height: auto;
}
#Staff_Online td {
display: block;
}
</style>