Topic: AJAX, Stylesheet, and Browser Issues

In my app the stylesheet will load in Firefox in some cases, but not in others (ie-one user profile to the next).  There are no obvious differences between the setups of the various users.  Also, when viewed in Safari, the stylesheets fails to load in every case so far.

I am also having problems with AJAX.  I wrote some JavaScript into one of the pages, and it worked fine, so I know JavaScript is running.  However, the AJAX I have in another page doesn't work except in one user's instance of Safari.  With all other combinations of users and browsers, the AJAX doesn't work (ie-The AJAX is an observe_field, in all other combinations the function is never even called).

I hope this is not too unclear and someone can help me with these issues.

Re: AJAX, Stylesheet, and Browser Issues

It would seem that all of the problems are being caused by files in public/stylesheets and/or public/javascripts not being loaded.  I cannot figure out why this is happening though.  I am using the standard stylesheet_link_tag and javascript_include_tag for all of this.  The app is running on WEBrick for development.

Re: AJAX, Stylesheet, and Browser Issues

Do you call stylesheet_link_tag with the <%= %> tag or just the <% %> tag?

Re: AJAX, Stylesheet, and Browser Issues

Both the stylesheet_link_tag and javascript_include_tag are called inside <%= %> tags.

Re: AJAX, Stylesheet, and Browser Issues

Like this?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <title>Example <%= controller.action_name %></title>
  <%= stylesheet_link_tag 'scaffold' %>
 
  <%= javascript_include_tag "prototype" %>
  <%= javascript_include_tag "effects" %>
  <%= javascript_include_tag "controls" %>
</head>
<body>
<%= yield  %>
</body>
</html>


For AJAX the best is Firefox with Firebug

Re: AJAX, Stylesheet, and Browser Issues

Yes, that is similar to what I currently have.

Re: AJAX, Stylesheet, and Browser Issues

So do the tags show up properly in your layout?  If not, you've got a crazy bug that can only have come from some plugin or library taking liberties with the include tags.

If the tags show up and the page isn't rendered correctly then check the location of your files.  Are they really under /public/stylesheets and /public/javascripts?  Is /public the equivalent of http://host/ ?

Re: AJAX, Stylesheet, and Browser Issues

Here's a more in-depth description of the situation:  the app is being hosted on a single machine, separate from the one I am developing it on, but I can access that machine across the network.  The address for the stylesheet appears correctly when I view the source for each page.  The only problem is that some machines on the network, when their browsers are pointed to the address of the stylesheet, the stylesheet is nowhere to be found, but other machines find it no problem.  As this problem has developed it has become apparent that the problem may be outside the scope of this forum, or even Rails in general, but maybe not.  Currently my guess is some type of webserver, web browser, or network routing bug.  I really don't know though.

Re: AJAX, Stylesheet, and Browser Issues

I have determined with relative certainty that the problem lies somewhere inside the file called .htaccess which can be found in the public/ directory of my rails app.  If anyone can give me more information on what this file does, what it's for, what the code inside means, etc. it would be greatly appreciated.  I have not changed this file at all for my app.