Forum: Rails deployment Uploadify is not a function

9813e122da90c7ec09575c56b740bea3?d=identicon&s=25 Yang Chung (ychung74)
on 2009-10-08 00:48
I've been trying to get uploadify to work, but can't. I am following the
tutorial by John Nunemaker.

Mine seems to be quite basic, but I just can't figure why it wouldn't
work.....

In my layouts/application.html.erb

[code]
  <%= javascript_include_tag 'uploadify/jquery-1.3.2.min.js' %>
  <%= javascript_include_tag 'uploadify/jquery.uploadify.v2.1.0.min.js'
%>
  <%= javascript_include_tag 'uploadify/swfobject.js' %>
  <%= javascript_include_tag :defaults %>
[/code]

In my view,

[code]
<%- session_key_name = ActionController::Base.session_options[:key] -%>
<script type="text/javascript">
  $ = jQuery.noConflict();

  $(document).ready(function() {
      $('#upload_files').uploadify({
        'uploader'    : '/javascripts/uploadify/uploadify.swf',
        'script'      : '/javascripts/uploadify/uploadify.php',
        'multi'       : true,
        'scriptData'  : {
                          '<%= session_key_name %>' :
encodeURIComponent('<%= u cookies[session_key_name] %>'),
                          'authenticity_token'  :
encodeURIComponent('<%= u form_authenticity_token if
protect_against_forgery? %>')
                        }
      });
  });
</script>

<input type="file" name="upload_files" id="upload_files" />
[/code]

When the page is loaded I get the following error in Firebug

[code]
$("#upload_files").uploadify is not a function
[/code]

What gives?

I could really appreciate someone's help on this.

Thank you in advance!
B7ae8ccf0388ec5b1d2c3487450799cf?d=identicon&s=25 island Voodoo (voodooisland)
on 2009-11-06 14:26
Make sure the page only imports Jquery only one time.
<script src="/js/jquery-1.3.2.min.js" type="text/javascript"></script>
must appear only once in the whole page (analyse the html code client
side)
—voodoo
A58efeee01e2d1e85e12137430fa0374?d=identicon&s=25 Priya Saini (priyasaini)
on 2009-12-30 12:20
island Voodoo wrote:
> Make sure the page only imports Jquery only one time.
> <script src="/js/jquery-1.3.2.min.js" type="text/javascript"></script>
> must appear only once in the whole page (analyse the html code client
> side)
> —voodoo

Hi:

I am facing the same problem and the jquery file has been included only
once.
Please suggest.

TIA,
Priya Saini
This topic is locked and can not be replied to.