Chat works so localhost

0

Hello! I have a chat that only works on localhost (XAMP), when I do UPLOAD for hosting, it just does not work.

// start new chat-box
$('body').on('click', '.js_chat-start', function(e) {
    /* get data from (header conversation feeds || master online widget) */
    /* mandatory  */
    var uid = $(this).data('uid');
    var name = $(this).data('name');
    /* optional (case: conversation feeds) */
    var conversation_id = $(this).data('cid') || false;
    var multiple = ($(this).data('multiple') == "true")? true: false;
    var name_list = $(this).data('name-list') || name;
    /* check if (create a new conversation || load previous conversation) */
    if(uid === undefined) {
        if(!chat_enabled || $(window).width() < 970) { // Desktops (≥992px)
            return;
        } else {
            e.preventDefault();
            /* open fresh chat-box */
            /* check if there is any fresh chat-box already exists */
            if($('.chat-box.fresh').length == 0) {
                /* construct a new one */
                $('body').append(render_template('#chat-box-new'));
                $('.chat-box.fresh').find('.chat-widget-content').toggle();
                /* initialize the main plugins */
                initialize();
                /* reconstruct chat-widgets */
                reconstruct_chat_widgets();
            } else {
                /* open fresh chat-box that already exists if not opened */
                if(!$('.chat-box.fresh').hasClass('opened')) {
                    $('.chat-box.fresh').addClass('opened');
                    $('.chat-box.fresh').find('.chat-widget-content').toggle();
                }
            }
        }
    } else {
        /* load previous conversation */
        /* check if the viewer in the messages page & open already conversation */
        if(window.location.pathname.indexOf("messages") != -1 && conversation_id) {
            e.preventDefault();
            $(".js_conversation-container").html('<div class="loader loader_medium pr10"></div>');
            $.getJSON(api['conversation/get'], {'conversation_id': conversation_id}, function(response) {
                /* check the response */
                if(response.callback) {
                    eval(response.callback);
                } else {
                    $(".js_conversation-container").html(response.conversation);
                }
            })
            .fail(function() {
                modal('#modal-message', {title: __['Error'], message: __['There is something that went wrong!']});
            });
        } else {
            if(!chat_enabled || $(window).width() < 970) { // Desktops (≥992px)
                if(conversation_id) {
                    return;
                } else {
                    e.preventDefault();
                    $.getJSON(api['conversation/check'], {'uid': uid}, function(response) {
                        /* check the response */
                        if(!response) return;
                        if(response.callback) {
                            eval(response.callback);
                        } else {
                            if(response.conversation_id) {
                                window.location = site_path + "/messages/" + response.conversation_id;
                            } else {
                                window.location = site_path + "/messages/new";
                            }
                        }
                    })
                    .fail(function() {
                        modal('#modal-message', {title: __['Error'], message: __['There is something that went wrong!']});
                    });
                }
            } else {
                e.preventDefault();
                /* load chat-box */
                chat_box(uid, name, conversation_id, multiple, name_list);
            }
        }
    }
});
//Botão "js_chat-start"

<div class="data-container clickable small js_chat-start" data-uid="4" data-name="Nome Usuário" data-picture="http://nomesite.com/content/themes/default/images/foto_usuario.jpg">
	<img class="data-avatar" src="http://nomesite.com/content/themes/default/images/foto_usuario.jpg"alt="Usuário">
	<div class="data-content">
		<div class="pull-right flip">
			<i class="fa fa-circle chat-sidebar-online"></i>
		</div>
		<div>
			<strong>Nome Usuário</strong>
		</div>
	</div>
</div>

Thank you in advance!

    
asked by anonymous 12.05.2018 / 16:15

0 answers