You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Bo Gao <el...@gmail.com> on 2011/07/13 10:29:43 UTC

Prevent a page from generating any javascript or css.

Prevent a particular page from generating any javascript or css.
I know a method to provide a JavaScriptStack, but this will affect all pages, 
I want only one page don't render so many js files.
How to do this.

--
Bo Gao
elivoa@gmail.com





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


Re: Prevent a page from generating any javascript or css.

Posted by Bo Gao <el...@gmail.com>.
Thanks nillehammer

You are right, this is not an issue. I found that the request send is
/assets/0.1.0/core/scriptaculous_1_8_2/prototype.js?_=1310547743256
there is a timestamp after the url, and it will be always "HTTP/1.1 200 OK".
I found the problem is that I use jquery.load(), and I found a way to remove the 
timestamp by calling jQuery.ajaxSetup({ cache : true });

	
On Jul 13, 2011, at 5:44 PM, nillehammer wrote:

> Hi Bo Gao
>> In fact I want to load a page using ajax, but the page returned contains
>> many javascript files like /assets/0.1.0/core/scriptaculous_1_8_2/prototype.js?_=1310547743256
>> This increase many requests.
>> And these javascript may be already loaded. I just want to remove these.
> That is not really an issue. You're right that the requests are made everytime by the browser. But as js-Files are cached, the request/response is different the second time. The first time your browser requests a js-File, the Server will deliver it with a "HTTP/1.1 200 OK ". Now the js-File is cached by your browser. The second time you do a request, the browser does not ask dumbly for the same file again but asks the server, if a newer version exists by sending a "If-Modified-Since:" header with the request. This is answered with a "HTTP/1.1 304 Not Modified ". So js-Files only go over the wire the first time they are requested. Later it's just checking, if they have been modified. This rule applies to all assets (css, gifs etc.).
> 
> Regards nillehammer
> 
> -- 
> http://www.winfonet.eu
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 

--
Bo Gao
elivoa@gmail.com





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


Re: Prevent a page from generating any javascript or css.

Posted by nillehammer <ta...@winfonet.eu>.
Hi Bo Gao
> In fact I want to load a page using ajax, but the page returned contains
> many javascript files like /assets/0.1.0/core/scriptaculous_1_8_2/prototype.js?_=1310547743256
> This increase many requests.
> And these javascript may be already loaded. I just want to remove these.
That is not really an issue. You're right that the requests are made 
everytime by the browser. But as js-Files are cached, the 
request/response is different the second time. The first time your 
browser requests a js-File, the Server will deliver it with a "HTTP/1.1 
200 OK ". Now the js-File is cached by your browser. The second time you 
do a request, the browser does not ask dumbly for the same file again 
but asks the server, if a newer version exists by sending a 
"If-Modified-Since:" header with the request. This is answered with a 
"HTTP/1.1 304 Not Modified ". So js-Files only go over the wire the 
first time they are requested. Later it's just checking, if they have 
been modified. This rule applies to all assets (css, gifs etc.).

Regards nillehammer

-- 
http://www.winfonet.eu


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


Re: Prevent a page from generating any javascript or css.

Posted by Taha Hafeez <ta...@gmail.com>.
Hi

Ajax calls also require javascript and the zones depend on
prototype.js. (btw assets usually get cached by browser in production
mode, read about SymbolConstants.APPLICATION_VERSION on
http://tapestry.apache.org/configuration.html)

Also you can replace the default css by creating a blank file and
overriding the symbol SymbolConstants.DEFAULT_STYLESHEET with its
path.

http://tapestry.1045711.n5.nabble.com/How-to-remove-default-css-and-javascript-files-from-t5-td2428776.html

regards
Taha

On Wed, Jul 13, 2011 at 2:37 PM, Bo Gao <el...@gmail.com> wrote:
>
> I try a blank page, it contains many scripts like prototype.js.
> I just want a clear output like
> <html><body> my content </body></html>
>
> In fact I want to load a page using ajax, but the page returned contains
> many javascript files like /assets/0.1.0/core/scriptaculous_1_8_2/prototype.js?_=1310547743256
> This increase many requests.
> And these javascript may be already loaded. I just want to remove these.
>
> On Jul 13, 2011, at 4:36 PM, Taha Hafeez wrote:
>
> > Hi
> >
> > Just don't include any component that uses javascript. The default
> > stylesheet does get included even if you create a blank page but then you
> > can always override the css rules.
> >
> > regards
> > Taha
> >
> > On Wed, Jul 13, 2011 at 1:59 PM, Bo Gao <el...@gmail.com> wrote:
> >
> >> Prevent a particular page from generating any javascript or css.
> >> I know a method to provide a JavaScriptStack, but this will affect all
> >> pages,
> >> I want only one page don't render so many js files.
> >> How to do this.
> >>
> >> --
> >> Bo Gao
> >> elivoa@gmail.com
> >>
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
>
> --
> Bo Gao
> elivoa@gmail.com
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

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


Re: Prevent a page from generating any javascript or css.

Posted by Bo Gao <el...@gmail.com>.
I try a blank page, it contains many scripts like prototype.js.
I just want a clear output like
<html><body> my content </body></html>

In fact I want to load a page using ajax, but the page returned contains 
many javascript files like /assets/0.1.0/core/scriptaculous_1_8_2/prototype.js?_=1310547743256
This increase many requests.
And these javascript may be already loaded. I just want to remove these.

On Jul 13, 2011, at 4:36 PM, Taha Hafeez wrote:

> Hi
> 
> Just don't include any component that uses javascript. The default
> stylesheet does get included even if you create a blank page but then you
> can always override the css rules.
> 
> regards
> Taha
> 
> On Wed, Jul 13, 2011 at 1:59 PM, Bo Gao <el...@gmail.com> wrote:
> 
>> Prevent a particular page from generating any javascript or css.
>> I know a method to provide a JavaScriptStack, but this will affect all
>> pages,
>> I want only one page don't render so many js files.
>> How to do this.
>> 
>> --
>> Bo Gao
>> elivoa@gmail.com
>> 
>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
>> 

--
Bo Gao
elivoa@gmail.com





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


Re: Prevent a page from generating any javascript or css.

Posted by Taha Hafeez <ta...@gmail.com>.
Hi

Just don't include any component that uses javascript. The default
stylesheet does get included even if you create a blank page but then you
can always override the css rules.

regards
Taha

On Wed, Jul 13, 2011 at 1:59 PM, Bo Gao <el...@gmail.com> wrote:

> Prevent a particular page from generating any javascript or css.
> I know a method to provide a JavaScriptStack, but this will affect all
> pages,
> I want only one page don't render so many js files.
> How to do this.
>
> --
> Bo Gao
> elivoa@gmail.com
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>