I think putting that 17 lines in 'layout.html' is not a good idea, because 'layout.html' are there for you to replace or customize, putting more JS out there, users will need to implement that by their own.
And what is the difference being in web2py_ajax or in layout.html? as these files will be merged. But, there are things to be parsed until 53 lines not 17 (look at line 53) By the way, look http://web2py.com/book/default/chapter/10#web2py_ajax.html Nothing in web2py prevents you from using other Ajax libraries such as > Prototype, ExtJS, or YUI, but we decided to package jQuery because we find > it to be easier to use and more powerful than other equivalent libraries. We > also find that it captures the web2py spirit of being functional and > concise. If an app need to save bandwidth at this point, you can left 'web2py_ajax' and implement your own library. I agree that functions that does not needs to be parsed, can be stored in another separate JS file, but I see only 38 lines of 101 where it can be done. worth ? 2010/9/30 Manu <[email protected]> > Hi Bruno , > I agree with you for the first 17 lines , but after that it is just > regular javascript/jquery code !! Furthermore what is done in these > first 17lines is indeed parsed but could have been put somewhere else > ( in layout.html for ex, or in in another file that has to be included > in your custom layout) . Spliting the js part into another file may > actually shrink this web2y_ajax by 70% i guess( i agree that on the > overall page once generated it may not be that big ) . Savng bandwidth > and processing time is not useless for these applications and even if > i don't expect my apps to experiment high load maybe other could get > better results. Don't you think ? > > > > > On Fri, Oct 1, 2010 at 1:13 AM, Bruno Rocha <[email protected]> wrote: > > Correction: > > 'web2py_ajax.html' does not have string interpolation, this have to be > > parsed by web2py template system, because uses {{=xxxx}} notation to > build > > scripts. > > > > 2010/9/30 Bruno Rocha <[email protected]> > >> > >> In layout.html you can call external JS files using: > >> > >> > {{response.files.append(URL(request.application,'static/js','javascriptfile.js'))}} > >> Scripts are also loaded dinamicaly by 'web2py_ajax.html' which builds > the > >> JS script at runtime, as this uses string interpolation to build > scripts, > >> this could not be stored in a separate file. > >> I guess thats the reason. > >> 2010/9/30 Manu <[email protected]> > >>> > >>> Hi, > >>> > >>> What is the reason to not have these functions into a dedicated > >>> external file. By including it in the html page we can't use the > >>> browser cache and we need to transfer it again and again , sounds me a > >>> waste of time transfer and bandwidth. As i am not a web expert ( i am > >>> actually learning with web2py !! great tool to do that too ), i was > >>> wondering if there is a specific reason ? > >>> > >>> Thx > >> > >> > >> > >> -- > >> > >> http://rochacbruno.com.br > > > > > > > > -- > > > > http://rochacbruno.com.br > > > -- http://rochacbruno.com.br

