Question

I am creating a firebug extension. I need to display json in the panel, I am using textarea to display panel but it doesn't work, extension simply crashes. I tried this:

var template = domplate(
        { 

                tag:
                TEXTAREA({"class": "textEditorInner", type: "text"},json)
        });

but the plugin crashes, it works for normal text however.

Was it helpful?

Solution

Note that your json variable should contain a string with backslash escaped quotes when passing it to the template.

Other solution would be to first render your template

var textarea = template.render();

and then add the content afterwards via

textarea.value = json;

Of course you'll then need to remove the json from your template.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top