Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- url: "chat.php?action=chatheartbeat",
- cache: false,
- dataType: "json",
- success: function(data) {
- $.each(data.items, function(i,item){
- if (item) { // fix strange ie bug
- chatboxtitle = item.f;
- if ($("#chatbox_"+chatboxtitle).length <= 0) {
- createChatBox(chatboxtitle);
- }
- if ($("#chatbox_"+chatboxtitle).css('display') == 'none') {
- $("#chatbox_"+chatboxtitle).css('display','block');
- restructureChatBoxes();
- }
- if (item.s == 1) {
- item.f = username;
- }
- if (item.s == 2) {
- $("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxinfo">'+item.m+'</span></div>');
- } else {
- newMessages[chatboxtitle] = true;
- newMessagesWin[chatboxtitle] = true;
- $("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+item.f+': </span><span class="chatboxmessagecontent">'+$.parseHTML(item.m)+'</span></div>');
- }
- $("#chatbox_"+chatboxtitle+" .chatboxcontent").scrollTop($("#chatbox_"+chatboxtitle+" .chatboxcontent")[0].scrollHeight);
- itemsfound += 1;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement