Index if Google posted JSON in html tag?

On the page there is a hidden HTML tag inside which is a JSON string with the data.
JSON is in the HTML tag and not the SCRIPT tag.

Can search engines index the data inside tag?
Whether to index if the tag is not hidden, and for example position: absolute; top: -10000; left: -10000;

Your opinion?
Does anyone have any information about indexing JSON format search engines?

PS:

for those who are curious why: a Large tree reviews is advantageous to transmit to the client in JSON and there is almost instantly drawn. Server-based rendering of trees is terribly slow. Looking for a way somehow to get the search engines to index the old comments.

Thanks in advance!
October 3rd 19 at 19:48
2 answers
October 3rd 19 at 19:50
Big tree review it is advantageous to transmit to the client in JSON and there is almost instantly drawn. Server-based rendering of trees is terribly slow.

What? What makes you think that?
I understand that traffic from the server will be more (although this can be ignored), but why server-side rendering will be slower?
But if basically, then pass the JSON in the JS format, not in HTML tag. So search engines will index it.
And for those who have JS disabled (and for search engines in particular) give to prepared on server HTML. - Kayley_Legros46 commented on October 3rd 19 at 19:53
1) > but why server-side rendering will be slower?

we will not take the tree of comments — take something more — some kind of hierarchical structure in the admin area of a large project.

On the server:

584 elements
3 levels deep
for more than 30 seconds.

On the client structure of 2,000 items, 3 levels of nesting is drawn for 1 sec.

But a severe benchmark 16 000

3 level deep
25 nodes per level
16275 nodes in tree
Server rendering: 4906.3 ms (converting to JSON)
Client rendering: 3056ms (rendering and append to DOM)
Performance: 16275 / 7962 = 2045 nodes/second

16 000 nodes 3-level tree for 8 seconds. Not bad, right?

There is a difference?

2) to insert JSON in a SCRIPT tag is impossible. Otherwise you'll spend [script]alert(1)[script] if they are

but such thing works as it should.

tree = JSON.parse( $('#json_tree').html() );

and even implemented [script]alert(1)[script] normally perceives as text. Try it for yourself.

And there is still hope that JSON even as it recognized by the search engines. Only not evidence of no denials I have.

Can someone tell me at least something at the expense of indexing by search engines? At least guess? - shea_Da commented on October 3rd 19 at 19:56
I believe that the easiest way to check is to find the low-frequency request, fill in the database with the demo data comparable to the subject, add the site to indexing by the search engine and once webmaster tools shows that the page is indexed try search the website for key phrases from the generated comments.

In General, the hidden units the search engines suspicious. There's too much chance of cloaking when the user content is, and the robot another. Maybe there is an option to make it more or less visible? For example, in a noscript block? - dario.Boyle commented on October 3rd 19 at 19:59
Interested )

1) I do Not understand what you are doing. You get some data, presumably from the database. Next, you wrap them in HTML and give to the client. Why is this simple operation you have on the server is 30 seconds and the client for less than 1 second? Maybe the problem is somewhere in the architecture or code?

2) Screen and filter the data to avoid problems. I'm not suggesting you to embed JSON in a SCRIPT tag, I offered to give him the type var data = ; - Kayley_Legros46 commented on October 3rd 19 at 20:02
1) What happens on the server and why it happens that way is another story. I don't want to delve into this question.
There is a solution to give data on the client and draw there. At the moment the solution showed himself well.

2)

And yet you propose to do that?

the <script> //<![CDATA[ var _data = { field: "</script><script>alert(1)</script>" } //]]>

Try it and see cherished alert.

I can't escape the data itself. I use a standard Converter array of JSON objects available in my environment. Additional options that would have made escapeHTML in the fields with the data in this Converter no.

There is an option of course to write a patch for Converter — but I am not yet happy. I have described a method of transmitting data using html tag solves the problem of transmission of threat data. - shea_Da commented on October 3rd 19 at 20:05
Why is it the way that you describe (tree = JSON.parse( $('#json_tree').html() );) solves the problem?
If you have <div id="json_tree">{ field: "<script>alert(1)</script>" }</div>? - Kayley_Legros46 commented on October 3rd 19 at 20:08
And this is the way an interesting question. Apparently the template is doing something interesting with Steve data. As soon as I will understand — just write, but probably it will be tomorrow. Do not switch. - shea_Da commented on October 3rd 19 at 20:11
A few words about the box JSON.

The situation is such that the template engine does escape content which is inserted to the page.
Here is an example of inserting JSON into html using SCRIPT and HTML tag. I throw it to the file — otherwise escape returns to the parentheses and quotes.

test JSON

The point is, in this example

JSON.parse(tree) not working

and

JSON.parse( $('.data').html() ) works very fine.

If you have any ideas why — I will be glad to hear. - shea_Da commented on October 3rd 19 at 20:14
Why the server is drawn so long?! Probably because the fragments of the species are distributed in files — one file controls — the other kind of tree node in another wrapper tree. If there are many items, then repeatedly invoked for every piece type and the total time is more. Although experiments in the break, when everything was in one place, showed not the best results. Maybe it's environmental issues. I can't say. - shea_Da commented on October 3rd 19 at 20:17
JSON.parse(tree) not working and JSON.parse( $('.data').html() ) works very fine.
In the first case you have " instead of quotation marks, and the second jQuery will return to normal quotes. - Kayley_Legros46 commented on October 3rd 19 at 20:20
In the first case you have " instead of "
Evil parser. - Kayley_Legros46 commented on October 3rd 19 at 20:23
Well, Yes. Just the fact that this is a good for me a feature of work $('.data').html() — because the original strings are identical. That's why I use at the moment exactly this way. - shea_Da commented on October 3rd 19 at 20:26
October 3rd 19 at 19:52
Insert into attribute data. jQuery even automatically rasarit JSON:
<article class="boat" data-schedule="['Moscow', 'Paris']">...</article>
$('.boat').data('schedule') === ['Moscow', 'Paris'];
approx. the same option, but in fact still parsing — nothing win. But yeah, that's better. I agree. - Kayley_Legros46 commented on October 3rd 19 at 19:55
Again why I don't do that — because I hope that JSON is inserted in the tags will be somehow indexed. - shea_Da commented on October 3rd 19 at 19:58
Ha, I thought the opposite, that the goal is to hide from search engines.

I would astorian with this indexing the "hidden" text, and then bot your case is indistinguishable from <span style="color:white">download porn free</span> - dario.Boyle commented on October 3rd 19 at 20:01

Find more questions by tags ProgrammingSearch enginesJSONFrontendWeb Development