Lightbox2 javascript file behavior different on web server and localhost?

I am running locally and using Lightbox2 (
http://www.lokeshdhakar.com/projects/lightbox2/)
to open a picture from a thumbnail

see site : http://www.ceramique-isabelle.fr (see ceramiques, click
thumbnail, then click the left picture)

in my layout I wrote this line to load the js in sequence as stated by
lightbox2
<%= javascript_include_tag ‘prototype’, ‘scriptaculous’, ‘lightbox’,
‘widgEditor’, ‘application’, :cache => true %>

and the lightbox link is :

<%= image_tag( left_box_image(@c, @p), :size =>
@left_image_size, :border => 0, :id => ‘imageLeft’) -%>

with a helper to build the link according to the clicked image
big_image_link(c, p)
return “#{WWW_HOST}/images/#{params[:controller]}/big/
#{params[:controller][0,1]}” + c.to_s + “d” + p.to_s + ‘.jpg’

so locally I get : <a href=“http://localhost:3000/images/aquarelles/
big/a1d0.jpg” …
and the image displays into the lightbox.

I can even use a link to my web server, and running locally , the
image displays too… !
<a href=“http://www.ceramique-isabelle.fr/images/aquarelles/big/
a1d0.jpg” …

but when running from the web server, the image doesn’t display, I get
a js error :
Error : Builder is not defined
Source file :
http://www.ceramique-isabelle.fr/javascripts/all.js?1220286151
LIne : 4417

then (which seems normal to get this 2 error after the first… )
Error : $(“overlay”) is null
Source file :
http://www.ceramique-isabelle.fr/javascripts/all.js?1220286151
Line : 4494

what could be different between my web server and my local server …
(same Rails level… 2.1)

On 1 Sep 2008, at 18:02, Erwin wrote:

I am running locally and using Lightbox2 ( http://www.lokeshdhakar.com/projects/lightbox2/)
to open a picture from a thumbnail

Does it work when running in production mode locally ?

Fred

yes, at least I hope so… (never run in production mode
locally … just RAILS_ENV=production in the console ?..)

the javascript error is actually Builder not loaded…
in the scriptaculous file :

(includes ? includes[1] :
‘builder,effects,dragdrop,controls,slider,sound’).split(’,’).each(
function(include) { Scriptaculous.require(path+include
+’.js’) });

I am quite sure it’s a js file loading problem… not a Rail
problem,
but what could be the difference between being local dev and remote
production … ???

I modified the header…

still running fine locally .. but same problem on web server (crashed one hour ago... not my fault...°

On Sep 1, 8:02 pm, Erwin [email protected] wrote:

I am quite sure it’s a js file loading problem… not a Rail
problem,
but what could be the difference between being local dev and remote
production … ???

Because in production mode those files are cached and combined into
one, but not in dev mode

Fred

OK, I solved it testing direct links to js file …

solved it..... not loading the scriptaculous.js file did the trick..... thanks for your help..