Character escaping for javascript

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Character escaping for javascript

Jean Couteau
Hi list,

I am trying to insert some ajax on my wiki, but i am facing an issue
with character escaping :

I'm trying to have this :

<td><p id="1,0,0,0,3status"> Todo </p><script type="text/javascript">
new
Ajax.InPlaceCollectionEditor('1,0,0,0,3status','/xwiki2/bin/edit/Project/plannerv2?xpage=assignStatus&id=1,0,0,0,3',{
collection:['Todo','In progress','Dev done','Done'], ajaxOptions:
{method: 'post'} });</script></td>

What I can get is either replacing the [ character with its html code
(using the escaping character) or having xwiki rendering a link.

No success having what i wanted.

I am using xwiki version 1.5 (so syntax 1.0)

So my question is : is there a way to escape a character without getting
its html code ?

Thanks in advance

Jean

--
----
Jean Couteau
Code Lutin - http://www.codelutin.com
44 Bd des Pas Enchantés - 44230 St-Sébastien/Loire
Tél : 02 40 50 29 28 - Fax : 09 59 92 29 28

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Character escaping for javascript

Sergiu Dumitriu-2
Jean Couteau wrote:
> Hi list,
>
> I am trying to insert some ajax on my wiki, but i am facing an issue
> with character escaping :
>
> I'm trying to have this :

Try:

{pre}

> <td><p id="1,0,0,0,3status"> Todo </p><script type="text/javascript">
> new
> Ajax.InPlaceCollectionEditor('1,0,0,0,3status','/xwiki2/bin/edit/Project/plannerv2?xpage=assignStatus&id=1,0,0,0,3',{
> collection:['Todo','In progress','Dev done','Done'], ajaxOptions:
> {method: 'post'} });</script></td>

{/pre}

> What I can get is either replacing the [ character with its html code
> (using the escaping character) or having xwiki rendering a link.
>
> No success having what i wanted.
>
> I am using xwiki version 1.5 (so syntax 1.0)
>
> So my question is : is there a way to escape a character without getting
> its html code ?
>
> Thanks in advance
>
> Jean
>


--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Character escaping for javascript

Jean Couteau
Thanks Sergiu,

that's working now. I did not thought of this one as my script is
generated with velocity, but putting the {pre} instruction like that :
{pre}['Todo','In progress','Dev done','Done']{/pre}, works.


Sergiu Dumitriu a écrit :

> Jean Couteau wrote:
>  
>> Hi list,
>>
>> I am trying to insert some ajax on my wiki, but i am facing an issue
>> with character escaping :
>>
>> I'm trying to have this :
>>    
>
> Try:
>
> {pre}
>
>  
>> <td><p id="1,0,0,0,3status"> Todo </p><script type="text/javascript">
>> new
>> Ajax.InPlaceCollectionEditor('1,0,0,0,3status','/xwiki2/bin/edit/Project/plannerv2?xpage=assignStatus&id=1,0,0,0,3',{
>> collection:['Todo','In progress','Dev done','Done'], ajaxOptions:
>> {method: 'post'} });</script></td>
>>    
>
> {/pre}
>
>  
>> What I can get is either replacing the [ character with its html code
>> (using the escaping character) or having xwiki rendering a link.
>>
>> No success having what i wanted.
>>
>> I am using xwiki version 1.5 (so syntax 1.0)
>>
>> So my question is : is there a way to escape a character without getting
>> its html code ?
>>
>> Thanks in advance
>>
>> Jean
>>
>>    
>
>
>  


--
----
Jean Couteau
Code Lutin - http://www.codelutin.com
44 Bd des Pas Enchantés - 44230 St-Sébastien/Loire
Tél : 02 40 50 29 28 - Fax : 09 59 92 29 28


_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users