Jahia Template Forum > How to remove javascript...

0 (0 Good)
0 (0 Bad)

How to remove javascript from template?

by  mabouchacra »  2011/06/07 20:11

Hi there,

We've noticed that in every of our generated html page there is some javascript added in the source.
The javascript I'm refering is the following :

[code:2nlbobl1]
lt;SCRIPT type=text/javascript

  (mabouchacra)

Number of messages  44
Registration date
0 (0 Good)
0 (0 Bad)

Re: How to remove javascript from template?

by  shuber »  2011/06/07 20:11

Try setting the includeGWTCss value to false on the template tag.

Regards,
Serge Huber.

Serge Huber (shuber)

Number of messages  271
Registration date
0 (0 Good)
0 (0 Bad)

Re: How to remove javascript from template?

by  mabouchacra »  2011/06/07 20:11

Hi,

I've changed my templateBody tag to this : lt;template:templateBody includeGWTCss=

  (mabouchacra)

Number of messages  44
Registration date
0 (0 Good)
0 (0 Bad)

Re: How to remove javascript from template?

by  shuber »  2011/06/07 20:11

Hi Marc,

Actually this setting is on the template:templateHead tag.

So something like : lt;template:templateHead includeGwtCSS=

Serge Huber (shuber)

Number of messages  271
Registration date
0 (0 Good)
0 (0 Bad)

Re: How to remove javascript from template?

by  mabouchacra »  2011/06/07 20:11

Hello,

In fact, I've already tried it whithout succes.
As it's not present on the javadoc, i've tried it on the lt;template:template

  (mabouchacra)

Number of messages  44
Registration date
0 (0 Good)
0 (0 Bad)

Re: How to remove javascript from template?

by  mabouchacra »  2011/06/07 20:11

It seems that we can't remove the JS script present in the body and relating to the jahia_gwt_messages variable.
We've been digging in the Jahia source code and found out that in the TemplateBodyTag.java class, in the doEndTag() method the string quot;

  (mabouchacra)

Number of messages  44
Registration date
0 (0 Good)
0 (0 Bad)

Re: How to remove javascript from template?

by  shuber »  2011/06/07 20:11

You're right, I missed that one.

If you want you could patch the class and attach the patch to our issue tracker. We could then review the patch and if it looks good commit it.

Regards,
Serge Huber.

Serge Huber (shuber)

Number of messages  271
Registration date
0 (0 Good)
0 (0 Bad)

Re: How to remove javascript from template?

by  mabouchacra »  2011/06/07 20:11

Hello,

The thing is we don't know what this JS is used for. If it's here, it's probably for something. So we don't know what would be the impact of removing it.

Another thing is, while you're logged in, there are some JS which contain information about the serveur (serveurPath, currentUser, etc). Those information are not present while you are not logged in.
However, when we send the newsletter, we are logged in. Thus, everything is sent to the subscribers, which is a lack of security.

So is there a possibility to remove at least the JS present in the header, which contains information that should not be sent to everybody, and keep the JS in the body, as we've seen that we can't remove it?

Cheers,
Marc.

  (mabouchacra)

Number of messages  44
Registration date
0 (0 Good)
0 (0 Bad)

Re: How to remove javascript from template?

by  wassek »  2011/06/07 20:11

Hi Marc,

The problem the attribute includeGwtCSS is only available in the template:templateHead tag but it is a new attribute it was added in Jahia 6.1.1_HF3 build 37857 (downloadable on our extranet).
The attribute supress the inclusion of the GWT js files and GWT JS Header information.

The attribute is only available since this hotfix for that we didn't update the javadoc because the javadoc is working related to all Jahia 6.1.1 versions.

The JS at the end of the page is a dictionary, which only contains message which are used for common multilingual javascript messages if it is needed.
Currently no option exists to supress this dictionary GWT messages.
For sure we should add the same attribute in templateBody tag as in the templateHead to supress this java code.

best regards
Werner Assek

Werner Assek (wassek)

Number of messages  24
Registration date
0 (0 Good)
0 (0 Bad)

Re: How to remove javascript from template?

by  mabouchacra »  2011/06/07 20:11

Hello Werner,

Thanks a lot for the answer. I'll download the latest hotfix and try the attribute.

Cheers,
Marc

  (mabouchacra)

Number of messages  44
Registration date
Contact
Share
Feedback

Get in touch

Whether you are a current user or if you are just evaluating Jahia, we are here to help.

Contact us

Share this page