Skip to content
Advertisement

Problem with JSON.stringify a tag outerHTML in multidimensional array

I’m trying to stringify a multidimensional array with some string and the outerHTML of an anchor tag. For some unknown (to me) reason, it adds a double to the outerHTML text resulting in invalid JSON.

JavaScript

The result is:

JavaScript

Advertisement

Answer

you need to console.log it

from experience, I can tell that you just copied this string from your dev console, after letting it debug-print the contents of that JSON Serialization.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement