Answer the question
In order to leave comments, you need to log in
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
Do the sites themselves have meta charset="UTF-8" in the output html?
var obj = {
"random182": {
"id": "bla-bla-bla",
"x": 16212
}
};
console.log(obj[(Object.keys(obj)[0])].x); // 16212
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
});
var json = '{"id": "bla-bla-bla","x": 16212}',
obj = JSON.parse(json);
alert(obj.id);
alert(obj.x)
alert(random182.id)
alert(random182.x)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question