aneeb Posted July 21, 2012 Share Posted July 21, 2012 Hey Everyone! i am writing a JavaScript code in which i am getting a JSON which prints the images names which are stored in the database, the code gets these images and puts them in a img tag.Now when i am running it it brings all of the images at once and error comes in the error console that it is not a function..The code is here <script> // Then own code$(function() { // Shorthand for $(document).ready(function() { $.getJSON('getphp.php', function(json) { var images = ''; $.each(json.userdata, function(i, image) { images = images + '<img src="images/' + image.a + '">'; }); $('#slideShow').html(images).gallery({directionNavHide: false}); }); });</script> Please help me i am new to this 1 Link to comment Share on other sites More sharing options...
thescientist Posted July 21, 2012 Share Posted July 21, 2012 what is the exact error and what line does it say it is on. Link to comment Share on other sites More sharing options...
aneeb Posted July 22, 2012 Author Share Posted July 22, 2012 the error is Error: $("#slideShow").html(images).gallery is not a functionSource File: http://localhost:8080/mano/slideshow/jquery-slideshow.htmlLine: 81 Link to comment Share on other sites More sharing options...
thescientist Posted July 23, 2012 Share Posted July 23, 2012 so where is gallery defined then? Is part of a library that you forgot to include? Link to comment Share on other sites More sharing options...
aneeb Posted July 24, 2012 Author Share Posted July 24, 2012 no gallery is not defined anywhere.. Link to comment Share on other sites More sharing options...
thescientist Posted July 24, 2012 Share Posted July 24, 2012 so what did you expect it to do? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now