Вопрос

i am using jquery form plugin to upload the images without page reload but it seems that it is not possible to add a click function.i dont know what im doing wrong?

code:

$(document).ready(function () {
var options = {  
    url:'img_handler.php',
    type:'POST', 
    success:function(data) {
        //all the events are handeled properly
    } 
};  
$(".post_the_img-sing").click(function () {///the probem is over here 
$('#post_image_to_stream-single').ajaxForm(options);
});
});

NOTE:its not possible for me to have the .post_the_img_sing button within the form


UPDATE:found out that i could use a submit button which is hidden then just add a click event to the div .post_the_img_sing

Это было полезно?

Решение

Looks fine to me, as far as this code goes... Have you checked the class names? Because in your code you have .post_the_img-sing but then you have written .post_the_img_sing...

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top