V
V
Vkok2016-02-13 22:10:07
htaccess
Vkok, 2016-02-13 22:10:07

Why does the encoding itself flies?

Hello, maybe someone has thoughts about - why does the encoding of sites flies by itself ?? you open htaccess , attribute AddDefaultCharset UTF-8 - everything starts working fine, until the next time. Hosting - TIMEWEB (TAYMVEB) / The people from the hosting themselves claim that everything is fine on their side ..

Maybe someone has come across something similar ??

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vladimir Noskov, 2016-06-12
@boch112

Do the sites themselves have meta charset="UTF-8" in the output html?

B
bumbay, 2014-10-23
@Andrano

var obj = {
   "random182": {
      "id": "bla-bla-bla",
      "x": 16212
   }
};

console.log(obj[(Object.keys(obj)[0])].x); // 16212

V
Vladimir Kazmirchuk, 2014-10-23
@WebDizi

It looks like you are using jQuery with the JSONP option enabled for the request
. Use:

$.getJSON( "ajax/test.json", function(data) {
     // в data объект java script
});

R
Rustamka Vorontsov, 2014-10-23
@rmfordev

var json = '{"id": "bla-bla-bla","x": 16212}',
    obj = JSON.parse(json);
alert(obj.id);
alert(obj.x)

If all the same not js but jquery, then it is already parsed to you)
alert(random182.id)
alert(random182.x)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question