I found a script online for uploading images with ajax. it all works fine, I can upload and save images to the database. I have some rudimentary php knowledge, javascript i am completely lost... at any rate here is what I have:
so I was thinking something like this:Code:if(response!="error" && response!=""){ $('<li></li>').appendTo('#files').html('<img src="+response+" border="0" alt="" /><br />').addClass('success'); } else{ $('<li></li>').appendTo('#files').text(file).addClass('error'); }
is that correct so far? count the number of images and add the number to the class, then delete by the class? should i use ID? does addId work like add class? .. oh and i could use the count Number to limit the number of uploads too??Code:if(response!="error" && response!=""){ Number++; $('<li></li>').appendTo('#files').html('<img src="+response+" border="0" alt="" /><a name="#" onclick="dev(Number)">remove</a><br />').addClass('+Number+'); } else{ $('<li></li>').appendTo('#files').text(file).addClass('error'); }
next how would i fire off my onclick? i'm so lost with javascript...![]()


Reply With Quote
Bookmarks