mstoth
2010-Apr-17 03:57 UTC
if your javascript doesn''t execute, but instead just gets displayed on the browser...
OK, I''ve been struggling for days trying to understand why my javascript is just being displayed on the browser rather than executed. I have found out the placement of the javascript_include_tag was my problem. I have other javascript code in my header and if I place the javascript_include_tag before my other javascript code I only see the javascript I''m trying to execute displayed in my browser. If I put it after my other code, it gets executed. I can not see what it is about my other javascript code that causes it to matter. it only consists of function definitions and quite honestly after wasting almost a week on this I don''t want to spend more time to figure that out. So if this happens to anyone else hopefully the will see this and make sure your javascript_include_tag :defaults is not being somehow ruined by having other javascript code after it. If anyone has some insight into this I''d love to hear it. -Michael -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2010-Apr-17 08:06 UTC
Re: if your javascript doesn''t execute, but instead just gets displayed on the browser...
On 17 April 2010 04:57, mstoth <michael-pFXmGr0c18V4uZT98XS8CNBPR1lH4CV8@public.gmane.org> wrote:> > OK, I''ve been struggling for days trying to understand why my > javascript is just being displayed on the browser rather than > executed. I have found out the placement of the > javascript_include_tag was my problem. > > I have other javascript code in my header and if I place the > javascript_include_tag before my other javascript code I only see the > javascript I''m trying to execute displayed in my browser. If I put it > after my other code, it gets executed. > > I can not see what it is about my other javascript code that causes it > to matter. it only consists of function definitions and quite > honestly after wasting almost a week on this I don''t want to spend > more time to figure that out. So if this happens to anyone else > hopefully the will see this and make sure your > javascript_include_tag :defaults is not being somehow ruined by having > other javascript code after it. >Have you tried pasting the html of the page into the w3c html validator (google will find it)? Sometimes strange problems can be seen as the browser attempts to make sense of invalid html. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.