Why won't jQuery show my hidden content?
I'm trying to have jQuery .show(); my content, but it never shows it! I checked the syntax, ad it all seems fine. Can anybody help me?
The URL of the content is http://craigslistcloud.com/
When you click Login it should show the class, .l开发者_StackOverflow中文版oginform-nav
Thanks!
You have both jQuery
and prototypejs
loaded.
I'd suggest using one or the other. If that's not a possibility, then call jQuery.noConflict()
, and replace your jQuery use of $
with jQuery
, or some replacement you define.
var $j = jQuery.noConflict();
$j(document).ready(function () {
$j('#custom_file_upload').uploadify({
'uploader': '/uploadify/uploadify.swf',
'script': '/uploadify/uploadify.php',
'cancelImg': '/uploadify/cancel.png',
'queueID': 'fileQueue',
'folder': '/uploads',
'multi': true,
'auto': true,
onComplete: function (event, queueID, fileObj, response, data) {
$j('#links').append('<img src="http://craigslistcloud.com' + encodeURI(response) + '" align="center" /><br><br><br><br>');
}
});
});
The url to the jQuery script (http://craigslistcloud.com/uploadify/jquery-1.4.2.min.js) is returning a 404. Which is why you are getting the error:
$(document).ready is not a function
Fix this and it should work.
Two immediate problems:
- You have the script that binds the click handler before the actual element. It can't find the element unless you either place the
<script>
after the<a id="Login">
or you wrap the code inside a$(function () { });
. - You have jQuery 1.3.2, jQuery 1.4.2 and prototype loaded on the same page. You will have conflicts. You need to remove one of the jQuery scripts and use
jQuery.noConflict()
or just always usejQuery
instead of$
.
精彩评论