You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by kent lai <ma...@virtuallyonline.net> on 2007/10/24 19:25:07 UTC

Setting charset of javascript includes?

Hi,
	I was using jquery validator plugin, and using wicket's  
HeaderContributor.forJavascript to include my script file.

	However, for IE, it was been recommended to append the attribute   
charset="ISO-8859-1" to the script tag to enable it to work.

	Is there a way (short of maybe subclassing HeaderContribute) to  
output this attribute?

	Thanks

Kent


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Setting charset of javascript includes?

Posted by kent lai <ma...@virtuallyonline.net>.
Sounds like thats the only way.
Probably will stick to this until jquery.validate.js has an update.

Thanks!

On 25 Oct 2007, at 5:33 PM, Matej Knopp wrote:

> I see, well, in that case you can use IHeaderResponse.renderText() to
> render the entire script tag on your own (you can look at the
> implementation of renderJavascriptReference to do something similiar
> just put the encoding attribute in there)
>
> -Matej
>
> On 10/25/07, kent lai <ma...@virtuallyonline.net> wrote:
>> My document is using charset utf-8, but the jquery.validate.js is
>> encoded with iso-8859-1. It caused javascript errors on ie6, and the
>> recommended resolution they had was to set the charset of the
>> <script> tag to iso-8859-1. I am not sure if they would ever change
>> it such that it works with utf-8, and I am not well versed in this
>> technology to know how to do the encoding myself.
>>
>> For now I am just creating my own IHeaderContribute to output a
>> script tag with the charset, but was wondering if there was any other
>> way.
>>
>>
>> On 25 Oct 2007, at 7:50 AM, Matej Knopp wrote:
>>
>>> Why do you want to append the charset attribute? Why do you need it?
>>> AFAIK if the charset is ommited the browser should use document
>>> charset for the javascript as well. I don't understand the usecase
>>> here.
>>>
>>> -Matej
>>>
>>> On 10/24/07, kent lai <ma...@virtuallyonline.net> wrote:
>>>> Hmm, or maybe even subclassing does not work as well.... digging  
>>>> into
>>>> the source, I might need to do my own custom renderHead to write  
>>>> that
>>>> out.
>>>>
>>>> Of course, including it directly in the html might be a better idea
>>>> then... anyone got any thoughts?
>>>>
>>>> On 25 Oct 2007, at 1:25 AM, kent lai wrote:
>>>>
>>>>> Hi,
>>>>>       I was using jquery validator plugin, and using wicket's
>>>>> HeaderContributor.forJavascript to include my script file.
>>>>>
>>>>>       However, for IE, it was been recommended to append the
>>>>> attribute
>>>>> charset="ISO-8859-1" to the script tag to enable it to work.
>>>>>
>>>>>       Is there a way (short of maybe subclassing
>>>>> HeaderContribute) to
>>>>> output this attribute?
>>>>>
>>>>>       Thanks
>>>>>
>>>>> Kent
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------ 
>>>>> --
>>>>> -
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------- 
>>>> --
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Setting charset of javascript includes?

Posted by Matej Knopp <ma...@gmail.com>.
I see, well, in that case you can use IHeaderResponse.renderText() to
render the entire script tag on your own (you can look at the
implementation of renderJavascriptReference to do something similiar
just put the encoding attribute in there)

-Matej

On 10/25/07, kent lai <ma...@virtuallyonline.net> wrote:
> My document is using charset utf-8, but the jquery.validate.js is
> encoded with iso-8859-1. It caused javascript errors on ie6, and the
> recommended resolution they had was to set the charset of the
> <script> tag to iso-8859-1. I am not sure if they would ever change
> it such that it works with utf-8, and I am not well versed in this
> technology to know how to do the encoding myself.
>
> For now I am just creating my own IHeaderContribute to output a
> script tag with the charset, but was wondering if there was any other
> way.
>
>
> On 25 Oct 2007, at 7:50 AM, Matej Knopp wrote:
>
> > Why do you want to append the charset attribute? Why do you need it?
> > AFAIK if the charset is ommited the browser should use document
> > charset for the javascript as well. I don't understand the usecase
> > here.
> >
> > -Matej
> >
> > On 10/24/07, kent lai <ma...@virtuallyonline.net> wrote:
> >> Hmm, or maybe even subclassing does not work as well.... digging into
> >> the source, I might need to do my own custom renderHead to write that
> >> out.
> >>
> >> Of course, including it directly in the html might be a better idea
> >> then... anyone got any thoughts?
> >>
> >> On 25 Oct 2007, at 1:25 AM, kent lai wrote:
> >>
> >>> Hi,
> >>>       I was using jquery validator plugin, and using wicket's
> >>> HeaderContributor.forJavascript to include my script file.
> >>>
> >>>       However, for IE, it was been recommended to append the
> >>> attribute
> >>> charset="ISO-8859-1" to the script tag to enable it to work.
> >>>
> >>>       Is there a way (short of maybe subclassing
> >>> HeaderContribute) to
> >>> output this attribute?
> >>>
> >>>       Thanks
> >>>
> >>> Kent
> >>>
> >>>
> >>> --------------------------------------------------------------------
> >>> -
> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>
> >>>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Setting charset of javascript includes?

Posted by kent lai <ma...@virtuallyonline.net>.
My document is using charset utf-8, but the jquery.validate.js is  
encoded with iso-8859-1. It caused javascript errors on ie6, and the  
recommended resolution they had was to set the charset of the  
<script> tag to iso-8859-1. I am not sure if they would ever change  
it such that it works with utf-8, and I am not well versed in this  
technology to know how to do the encoding myself.

For now I am just creating my own IHeaderContribute to output a  
script tag with the charset, but was wondering if there was any other  
way.


On 25 Oct 2007, at 7:50 AM, Matej Knopp wrote:

> Why do you want to append the charset attribute? Why do you need it?
> AFAIK if the charset is ommited the browser should use document
> charset for the javascript as well. I don't understand the usecase
> here.
>
> -Matej
>
> On 10/24/07, kent lai <ma...@virtuallyonline.net> wrote:
>> Hmm, or maybe even subclassing does not work as well.... digging into
>> the source, I might need to do my own custom renderHead to write that
>> out.
>>
>> Of course, including it directly in the html might be a better idea
>> then... anyone got any thoughts?
>>
>> On 25 Oct 2007, at 1:25 AM, kent lai wrote:
>>
>>> Hi,
>>>       I was using jquery validator plugin, and using wicket's
>>> HeaderContributor.forJavascript to include my script file.
>>>
>>>       However, for IE, it was been recommended to append the  
>>> attribute
>>> charset="ISO-8859-1" to the script tag to enable it to work.
>>>
>>>       Is there a way (short of maybe subclassing  
>>> HeaderContribute) to
>>> output this attribute?
>>>
>>>       Thanks
>>>
>>> Kent
>>>
>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Setting charset of javascript includes?

Posted by Matej Knopp <ma...@gmail.com>.
Why do you want to append the charset attribute? Why do you need it?
AFAIK if the charset is ommited the browser should use document
charset for the javascript as well. I don't understand the usecase
here.

-Matej

On 10/24/07, kent lai <ma...@virtuallyonline.net> wrote:
> Hmm, or maybe even subclassing does not work as well.... digging into
> the source, I might need to do my own custom renderHead to write that
> out.
>
> Of course, including it directly in the html might be a better idea
> then... anyone got any thoughts?
>
> On 25 Oct 2007, at 1:25 AM, kent lai wrote:
>
> > Hi,
> >       I was using jquery validator plugin, and using wicket's
> > HeaderContributor.forJavascript to include my script file.
> >
> >       However, for IE, it was been recommended to append the attribute
> > charset="ISO-8859-1" to the script tag to enable it to work.
> >
> >       Is there a way (short of maybe subclassing HeaderContribute) to
> > output this attribute?
> >
> >       Thanks
> >
> > Kent
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Setting charset of javascript includes?

Posted by kent lai <ma...@virtuallyonline.net>.
Hmm, or maybe even subclassing does not work as well.... digging into  
the source, I might need to do my own custom renderHead to write that  
out.

Of course, including it directly in the html might be a better idea  
then... anyone got any thoughts?

On 25 Oct 2007, at 1:25 AM, kent lai wrote:

> Hi,
> 	I was using jquery validator plugin, and using wicket's  
> HeaderContributor.forJavascript to include my script file.
>
> 	However, for IE, it was been recommended to append the attribute   
> charset="ISO-8859-1" to the script tag to enable it to work.
>
> 	Is there a way (short of maybe subclassing HeaderContribute) to  
> output this attribute?
>
> 	Thanks
>
> Kent
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org