There are several pages of html in different encoding (utf-8 / windows-1251). The following code is placed on them to load the javascript code (in utf-8):
help_url="http://eodiwojeidjweo.ru/chat_client/"; var hcc = document.createElement("script"); hcc.type ="text/javascript"; hcc.charset="windows-1251"; hcc.async =true; hcc.src =help_url+"chat_client.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hcc, s.nextSibling);
But! Unfortunately, on pages with windows-1251 encoding, the js script encoding is not displayed correctly. Although I'm trying to explicitly specify the required encoding: hcc.charset = "windows-1251". Making two versions of js in different encodings is a bad option. Translate all sites to utf-8 - not real.