Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8222781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:23:40+00:00 2026-06-07T14:23:40+00:00

I’ve ran into a strange bug in Ruby on Rails. I’m attempting to implement

  • 0

I’ve ran into a strange bug in Ruby on Rails. I’m attempting to implement the Uploadify JQuery library to handle multiple uploads using a flash object. I’m implementing this functionality on a tab that is loaded with Ajax. Previously I had my javascript_include_tag for my Uploadify js files on the same ajax page as the pertinent HTML affected by Uploadify. However, this produced some very odd results. Sometimes the calls to my Uploadify functions on that page would work, and other times it would fail completely. If in the case it didn’t work by switching between tabs and retrieving the Ajax page a second or third time it usually fixed the problem. Oddly enough if I inspected the HTML with Firebug the javascript link was nowhere to be seen even when the Javascript functionality was working, though I did see the network request for the file. I tried moving the javascript_include_tag for uploadify to the head tag in my application layout but then Uploadify flatout ceased to work completely.

When I pushed the uploadify functionality with the link tag on the Ajax page to my production server the problem was still present, but a lot less frequent. In fact I only noticed it a few times. Also this functionality ceases to work on any other browser period, just Firefox, but that might be a completely different issue that I’ll I have figure out (even though Javascript should be browser independent….).

Here’s what my head tag looked like when I tried to include the uploadify call in it:

%head
    %title Virtual Robot Games
    = stylesheet_link_tag 'style.css','web_app_theme.css', 'events.css', :media => 'screen'    
    = csrf_meta_tag         
    = javascript_include_tag 'jquery'
    = javascript_include_tag 'prototype'
    = javascript_include_tag 'noconflict.js'
    = javascript_include_tag 'effects.js'
    = javascript_include_tag 'calendar_date_select'
    = javascript_include_tag 'highlight'
    = javascript_include_tag 'textcounter'
    = javascript_include_tag 'scriptaculous.js'
    = javascript_include_tag 'collapsible.js'
    = javascript_include_tag 'bbhelp.js'
    = javascript_include_tag 'swfobject'
    = javascript_include_tag 'application' 
    = javascript_include_tag 'uploadify'

Extra info:

I’m using both Prototype and JQuery and they’re constantly conflicting with one-another, but I’m usually able to work around this. I’ve never had any scenarious where the two libraries were conflicting and I’ve had JQuery that only sometimes work. Usually if there’s a conflict it flat out won’t work at all.

EDIT
Actually I think I figured out the problem, I’m using the jquery-rails gem and I forgot to include the JQuery library in my Uploadify js file. Instead I had an inline link to googleapi. Replacing the google api link with the includes calls fixed the problem. Though my original question stands, should my JavaScript links all be stored in my head tag?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:23:42+00:00Added an answer on June 7, 2026 at 2:23 pm

    “Though my original question stands, should my JavaScript links all be stored in my head tag?”

    javascript_include_tag is just a helper which generates <script></script> element in the html markup. So you can add it for instance before end of the </body> or anywhere in the page. You can also use it in partials. The other common practice is to use content_for in templates/partials and in your layout the associated label for example in <head> section. The purpose of it is to load only relevant js, when only one part of the site is very JavaScript intensive (perhaps charts/graphics/reports etc.) and the other site modules do not use that js libraries at all (but all modules share common layout).

    So to sum it up, placement of javascript_include_tag depends more on the JavaScript execution rules on the html page than anything else. Use it as <script></script> element.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I am using Paperclip to handle profile photo uploads in my app. They upload
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.