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!
on 2009-10-08 00:48
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
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
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.