exactly.... it suppose to use a relative path... from the library: /* * Thickbox 3.1 - One Box To Rule Them All. * By Cody Lindley (http://www.codylindley.com) * Copyright (c) 2007 cody lindley * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php */
var tb_pathToImage = "images/loadingAnimation.gif"; /*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/ //on page load call tb_init $(document).ready(function(){ tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox imgLoader = new Image();// preload image imgLoader.src = tb_pathToImage; }); On Thu, Oct 8, 2009 at 4:51 PM, mdipierro <mdipie...@cs.depaul.edu> wrote: > > I never had to do this. All the JS libraries I ever used use relative > references since they do now know in which folder they are installed. > I do not understand. > > On Oct 8, 10:42 am, Álvaro Justen [Turicas] <alvarojus...@gmail.com> > wrote: > > On Thu, Oct 8, 2009 at 07:30, sebastian <sebastianov...@gmail.com> > wrote: > > > > > Hi All, > > > > > I am using a JS library (http://jquery.com/demo/thickbox/) which refer > > > to "images/something.jpg". That works perfectly on static HTML but > > > web2py translates it as "http://blabla/init/default/images/ > > > something.jpg". > > > > > as work around I'd like to create a controller names images that > > > returns the image in static/images. I'm sure that it would be 2 lines > > > of web2py... any ideas ? > > > > Yes, it happens with nicEdit[1] too. You have 3 ways to solve this > problem: > > > > 1- Change routes.py to redirect "/yourapp/default/images/blablabla" to > > "/yourapp/static/images/blablabla" (you may change routes_in and > > routes_out, see routes.example.py). This way the 'redirect' will be > > 'internally' - user won't get any redirect. > > > > 2- Create a function called images in default.py and redirects user to > > /static/images/request.args, something like that: > > def images(): > > redirect(URL(r=request, c='static', f='images/' + > '/'.join(request.args))) > > I don't like this second way since user will be redirected in all > requests. > > > > 3- Change JS code to point to "/yourapp/static/images/" instead of > "images/" > > > > I prefer 3rd option. :-) > > > > [1]http://www.nicedit.com/ > > > > -- > > Álvaro Justen > > Peta5 - Telecomunicações e Software Livre > > 21 3021-6001 / 9898-0141 > > http://www.peta5.com.br/ > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---