Hi All, I have a page in my application that is actually not part of the rails application but just a regular html web page. I''ve put that page in the public directory and when I try to view that page it takes a long time before it loads (20-30 seconds). I''ve narrowed down the problem to the line: <script language="javascript" type="text/javascript" src="includes/global.js"></script> which loads an external javascript file. My guess is that the .htaccess file is rewritting my browsers request for the global.js file into somewhere other than the includes directory and it cannot load the javascript file. Any ideas on how I can get it to load this javascript file for my regular web page? Thanks in advance.
Make sure that the file actually exists in public/includes/ If the file is not there, apache will try to dispatch it like a rails request. I''ve had similar problems before, and fixed it by making sure my path was all right. On 7/8/05, Jason Bellows <thejasonbellows-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> > Hi All, > > I have a page in my application that is actually not part of the rails > application but just a regular html web page. I''ve put that page in the > public > directory and when I try to view that page it takes a long time before it > loads > (20-30 seconds). I''ve narrowed down the problem to the line: > > <script language="javascript" type="text/javascript" > src="includes/global.js"></script> > > which loads an external javascript file. My guess is that the .htaccess > file is > rewritting my browsers request for the global.js file into somewhere other > than > the includes directory and it cannot load the javascript file. Any ideas > on how > I can get it to load this javascript file for my regular web page? Thanks > in > advance. > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Change the src="includes/global.js to src="/includes/global.js" as long as the includes folder is in you rRAILS_ROOT PUBLIC then you need the slash before the includes part for it to work. On Jul 8, 2005, at 3:28 PM, Jason Bellows wrote:> Hi All, > > I have a page in my application that is actually not part of the rails > application but just a regular html web page. I''ve put that page in > the public > directory and when I try to view that page it takes a long time > before it loads > (20-30 seconds). I''ve narrowed down the problem to the line: > > <script language="javascript" type="text/javascript" > src="includes/global.js"></script> > > which loads an external javascript file. My guess is that > the .htaccess file is > rewritting my browsers request for the global.js file into > somewhere other than > the includes directory and it cannot load the javascript file. Any > ideas on how > I can get it to load this javascript file for my regular web page? > Thanks in > advance. > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-Ezra Zygmuntowicz Yakima Herald-Republic WebMaster 509-577-7732 ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org