russian letters inside javascript script transform into diamonds -


i create items on page this

    var list_item = "";     if (eventstatus == 'canceled') {          list_item = '<li class="media list-group-item list-group-item-info"  id="tooltip" data-toggle="tooltip" data-placement="right" title="event canceled! impossible enroll!">';          tooltipflag = true;     }     else list_item = '<li class="media list-group-item list-group-item-info">';     list_item += '<a class="pull-left" href="#">';     list_item += '<img class="media-object img-thumbnail" src="holder.js/200x120" alt="no image">';     list_item += "</a>";     list_item += '<div class="media-body">';     list_item += '<h4 class="media-heading">';     if (eventstatus == 'canceled') list_item += name + ' <span class="label label-danger">' + eventstatus + ' <span class="glyphicon glyphicon-warning-sign"></span></span>';     else if (eventstatus == 'draft') list_item += name + ' <span class="label label-warning">' + 'soon' + ' <span class="glyphicon glyphicon-pencil"></span></span>';     else list_item += name + ' <span class="label label-primary">' + 'new' + ' <span class="glyphicon glyphicon-flag"></span></span>';     list_item += '</h4>';     list_item += '<p>' + description + '</p>';     list_item += '<br>';     list_item += '<div class="form-group pull-right">';     list_item += '<button type="submit" class="btn btn-info btn-sm" data-toggle="modal" id="info_button' + + '" data-target="#info' + + '" >';     list_item += '<span class="glyphicon glyphicon-info-sign"></span> Просмотреть информацию';     list_item += '</button>';     if (eventstatus == 'canceled') list_item += '<button type="submit" class="btn btn-success btn-sm disabled" data-toggle="modal" id="enroll" data-target="#enroll">';     else list_item += '<button type="submit" class="btn btn-success btn-sm" data-toggle="modal" data-target="#enroll">';     list_item += '<span class="glyphicon glyphicon-plus"></span> Записаться';     list_item += '</button>';     list_item += '</div></div></li>';     return list_item; 

but words Просмотреть информацию & Записаться enter image description here

but if write in html code - not in javascript function - looks properly.

what wrong?

assuming file encoded in utf-8 , served utf-8 (check settings of http server if necessary), can declare script in utf-8 in import :

<script charset="utf-8" src="yourfile.js"></script> 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -