Erwin
2008-Sep-01 17:02 UTC
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 : <a href="<%= big_image_link(@c, @p) %>" rel="lightbox" title="agrandissement"> <%= image_tag( left_box_image(@c, @p), :size => @left_image_size, :border => 0, :id => ''imageLeft'') -%> </a> 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) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Sep-01 17:54 UTC
Re: Lightbox2 javascript file behavior different on web server and localhost ?
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 thumbnailDoes it work when running in production mode locally ? Fred> > > 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 : > <a href="<%= big_image_link(@c, @p) %>" rel="lightbox" > title="agrandissement"> > <%= image_tag( left_box_image(@c, @p), :size => > @left_image_size, :border => 0, :id => ''imageLeft'') -%> > </a> > 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) > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Erwin
2008-Sep-01 19:02 UTC
Re: Lightbox2 javascript file behavior different on web server and localhost ?
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.. <script type="text/javascript" src="javascripts/prototype.js"></ script> <script type="text/javascript" src="javascripts/scriptaculous.js? load=effects,builder"></script> <script type="text/javascript" src="javascripts/lightbox.js"></ script> <script type="text/javascript" src="javascripts/widgEditor.js"></ script> <script type="text/javascript" src="javascripts/application.js"></ script> still running fine locally .. but same problem on web server (crashed one hour ago... not my fault...° On 1 sep, 19:54, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 > > > > > 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 : > > <a href="<%= big_image_link(@c, @p) %>" rel="lightbox" > > title="agrandissement"> > > <%= image_tag( left_box_image(@c, @p), :size => > > @left_image_size, :border => 0, :id => ''imageLeft'') -%> > > </a> > > 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)--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Sep-01 19:09 UTC
Re: Lightbox2 javascript file behavior different on web server and localhost ?
On Sep 1, 8:02 pm, Erwin <yves_duf...-ee4meeAH724@public.gmane.org> wrote:> 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 .... ??? >Because in production mode those files are cached and combined into one, but not in dev mode Fred> I modified the header.. > > <script type="text/javascript" src="javascripts/prototype.js"></ > script> > <script type="text/javascript" src="javascripts/scriptaculous.js? > load=effects,builder"></script> > <script type="text/javascript" src="javascripts/lightbox.js"></ > script> > <script type="text/javascript" src="javascripts/widgEditor.js"></ > script> > <script type="text/javascript" src="javascripts/application.js"></ > script> > > still running fine locally .. but same problem on web server (crashed > one hour ago... not my fault...° > > On 1 sep, 19:54, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > 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 > > > > 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 : > > > <a href="<%= big_image_link(@c, @p) %>" rel="lightbox" > > > title="agrandissement"> > > > <%= image_tag( left_box_image(@c, @p), :size => > > > @left_image_size, :border => 0, :id => ''imageLeft'') -%> > > > </a> > > > 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)--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Erwin
2008-Sep-02 10:15 UTC
Re: Lightbox2 javascript file behavior different on web server and localhost ?
OK, I solved it testing direct links to js file ... <script type="text/javascript" src="javascripts/prototype.js"></ script> <script type="text/javascript" src="javascripts/effects.js"></script> <script type="text/javascript" src="javascripts/builder.js"></script> <script type="text/javascript" src="javascripts/lightbox.js"></ script> solved it..... not loading the scriptaculous.js file did the trick..... thanks for your help.. On 1 sep, 21:09, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Sep 1, 8:02 pm,Erwin<yves_duf...-ee4meeAH724@public.gmane.org> wrote: > > > 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 .... ??? > > Because in production mode those files are cached and combined into > one, but not in dev mode > > Fred > > > > > > > I modified the header.. > > > <script type="text/javascript" src="javascripts/prototype.js"></ > > script> > > <script type="text/javascript" src="javascripts/scriptaculous.js? > > load=effects,builder"></script> > > <script type="text/javascript" src="javascripts/lightbox.js"></ > > script> > > <script type="text/javascript" src="javascripts/widgEditor.js"></ > > script> > > <script type="text/javascript" src="javascripts/application.js"></ > > script> > > > still running fine locally .. but same problem on web server (crashed > > one hour ago... not my fault...° > > > On 1 sep, 19:54, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > On 1 Sep 2008, at 18:02,Erwinwrote: > > > > > 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 > > > > > 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 : > > > > <a href="<%= big_image_link(@c, @p) %>" rel="lightbox" > > > > title="agrandissement"> > > > > <%= image_tag( left_box_image(@c, @p), :size => > > > > @left_image_size, :border => 0, :id => ''imageLeft'') -%> > > > > </a> > > > > 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)--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---