tags:

views:

28

answers:

1

I'm working with JSF and EXT js. I have a JSONArray created in the server-side and I want to pass it to client-side. I used to get the array and put it in javascript var. But this tag adds a html tag (span) which make an error in javascript var.

This is the code I wrote:

var data1 = <h:outputFormat value="#{actorBean.newactors}" />

And this is the code of my page after running:

var data1 =<span>[[&quot;aaaaaaa&quot;,&quot;bbbbbbb&quot;]]</span>

so do u have any idea how to get the array without all the tags added ? thanks

A: 

Use

<h:outputText value="#{actorBean.newactors}" escape="false">

The h:outputFormat is only interesting if you want to format your messages. The escape attribute of the h:outputText will disable escaping of HTML entities like " into &quot;.

BalusC
I want to escape the whole html tag :)my data should be this like this :var data1= [["aaa","bbb"]]so the problem persists with the "span" taghow can I strip this tag ?
Debbech
Then leave the `escape` attribute away. Only ensure that you don't give it any `id` or `styleClass` or consorts, it would indeed otherwise render a `<span>` (*with* the `id`, `class`, etc).
BalusC
I put it without these params and still get the span tag :(No id... no Style classIm desperate
Debbech