Codesnipp.it Social Code Sharing

Thim Kristoffersson

Ajax upload image script question

by Thim Kristoffersson on Jul 18, 2010

/* What do I need to do to get the post in the query, because now it just display nothing when I upload the image. I'm new to jquery so :/ */ <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;"/> <title></title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $("#hej").click(function(){ $('#uploaded').load('upload.php'); }); }); </script> </head> <body> <form enctype="multipart/form-data" method="post" action="#"> <input type="hidden" name="MAX_FILE_SIZE" value="4194304" /> <input type="file" name="uploadfile" class="file" size="25" /> <input type="submit" name="submit" value="Ladda upp bild" id="hej" /> </form> Tillåtna filtyper: png, jpg och gif <div id="uploaded"></div> </body> </html>

Can't see the comments? Please login first :)