Ringo commented on http://tapestry.apache.org/index.html

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

Ringo commented on http://tapestry.apache.org/index.html

no-reply
Hello,
    Ringo has commented on http://tapestry.apache.org/index.html.
    You can find the comment here:
    http://tapestry.apache.org/index.html#comment_5239
    Please note that if the comment contains a hyperlink, it must be approved
    before it is shown on the site.

    Below is the reply that was posted:
    ~~~~
    HI , thank you for your helpã002
my english is not very wellã002
here is the problemïF1B

when my page class like this

package com.rahwind.jjw.pages.login.xhhc;
@Import(library = { "IdentityVerify.js" })
public class IdentityVerify extends BaseComponents {
}

after it render done,html will like this
<script type="text/javascript" src="/assets/1.0-SNAPSHOT/app/pages/login/xhhc/IdentityVerify.js"></script>

ButïF0CI want it like this
<script type="text/javascript" charset="gbk" src="/assets/1.0-SNAPSHOT/app/pages/login/xhhc/IdentityVerify.js"></script>

Which means in my program ïF0CI need to specify their charset when i import a JS file.

How to do that ???

for now ,I write directly in the IdentityVerify.TML file.
<script src="${rootPath}/assets/1.0-SNAPSHOT/app/pages/login/xhhc/IdentityVerify.js" charset="gbk" type="text/javascript" />

But I know it's a wrong solutionã002
please help meïF0Cany hint will be greatã002ThanksïF01
    ~~~~

    With regards,
    The Apache Tapestry Project.

    You are receiving this email because you have subscribed to changes for the tapestry site.
    To stop receiving these emails, unsubscribe from the mailing list that is providing these notifications.
           

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Ringo commented on http://tapestry.apache.org/index.html

Daiuchuu Ginga
If you're using Tap 5.4 it's already implemented in tapestry require.js
module (META-INF/assets/tapestry5/require.js):

req.createNode = function (config, moduleName, url) {
        var node = config.xhtml ?
                document.createElementNS('http://www.w3.org/1999/xhtml',
'html:script') :
                document.createElement('script');
        node.type = config.scriptType || 'text/javascript';
        node.charset = 'utf-8';
        node.async = true;
        return node;
    };

but there is "utf-8" is hardcoded.

2016-03-27 7:40 GMT+04:00 <[hidden email]>:

> Hello,
>     Ringo has commented on http://tapestry.apache.org/index.html.
>     You can find the comment here:
>     http://tapestry.apache.org/index.html#comment_5239
>     Please note that if the comment contains a hyperlink, it must be
> approved
>     before it is shown on the site.
>
>     Below is the reply that was posted:
>     ~~~~
>     HI , thank you for your helpã002
> my english is not very wellã002
> here is the problemïF1B
>
> when my page class like this
>
> package com.rahwind.jjw.pages.login.xhhc;
> @Import(library = { "IdentityVerify.js" })
> public class IdentityVerify extends BaseComponents {
> }
>
> after it render done,html will like this
> <script type="text/javascript"
> src="/assets/1.0-SNAPSHOT/app/pages/login/xhhc/IdentityVerify.js"></script>
>
> ButïF0CI want it like this
> <script type="text/javascript" charset="gbk"
> src="/assets/1.0-SNAPSHOT/app/pages/login/xhhc/IdentityVerify.js"></script>
>
> Which means in my program ïF0CI need to specify their charset when i
> import a JS file.
>
> How to do that ???
>
> for now ,I write directly in the IdentityVerify.TML file.
> <script
> src="${rootPath}/assets/1.0-SNAPSHOT/app/pages/login/xhhc/IdentityVerify.js"
> charset="gbk" type="text/javascript" />
>
> But I know it's a wrong solutionã002
> please help meïF0Cany hint will be greatã002ThanksïF01
>     ~~~~
>
>     With regards,
>     The Apache Tapestry Project.
>
>     You are receiving this email because you have subscribed to changes
> for the tapestry site.
>     To stop receiving these emails, unsubscribe from the mailing list that
> is providing these notifications.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>