G
G
Goldsliders2021-07-21 09:22:33
JavaScript
Goldsliders, 2021-07-21 09:22:33

Why does the encoding change when inserting html through a script?

There is a script, it adds a link namely:

var links = '<a href="javascript:void();" onclick="submitForm(\'Y\'); return false;" id="ORDER_CONFIRM_BUTTON" class="fix-btn grey-btn order__btn checkout">Оформить заказ</a>';
$(".btn_box").html(links);

But on the front it looks like this
<a href="javascript:void();" onclick="submitForm('Y'); return false;" id="ORDER_CONFIRM_BUTTON" class="fix-btn grey-btn order__btn checkout">�������� �����</a>

Help)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexandroppolus, 2021-07-21
@Goldsliders

Try to save js file in utf8 encoding

I
Ilya Olovyannikov, 2021-07-21
@cannibal_corpse

Doubtful JS, of course)
But if the link comes from the back, then look at what headers the response sends.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question