jQuery - ariza formasida `` multipart/form-data` `ni yuboring va vazifangizni chaqiring?

Shuning uchun hozirda shunday shakl bor:

            <form method="POST" id="form_upload" enctype="multipart/form-data" action="./dev.html">
                
Name: <input type="text" class="required" name="file_name" />
 
                
File: <input type="file" name="datafile">
 
                <input type="submit" value="Upload" />
            </form>

Men jQuery ajax vositalari orqali sahifani yangilamasdan yuborishni xohlayman va (masalan, ogohlantirish) funksiyani ishga solaman. Bunday imkoniyat qanday va qanday amalga oshiriladi? (Agar iloji bo'lsa IE 6 BTW ... =)

3
mumkin bo'lgan dublikati Fayllarni jQuery bilan mos kelmaydigan tarzda qanday yuklashim mumkin?
qo'shib qo'ydi muallif keshu_vats, manba
Hozirgacha nimani sinab ko'rdingiz? Siz o'qiganmisiz? jQuery .get() va jQuery .ajax() vazifalari?
qo'shib qo'ydi muallif nnnnnn, manba
FormData sinfini jQuery ajax bilan tanishib chiqishingiz mumkin. Stackoverflow.com/savollar/5392344 /; hellip;
qo'shib qo'ydi muallif Anton Shchastnyi, manba

1 javoblar

Ehtimol, jQuery Form Plugin dan foydalanishingiz mumkin. Kod shu kabi bo'ladi:

<script type="text/javascript"> 
    $(document).ready(function() { 
        $('#form_upload').ajaxForm(function() { 
            alert("Thank you for your upload!"); 
        }); 
    }); 
</script> 
2
qo'shib qo'ydi
Javascript UZB
Javascript UZB
99 ishtirokchilar

@js_uzb @vuejs_uz @react_uz @nodejs_uz @angular_uz @ngTashkent @yiiframework_uz @laravel_uz @linux_uzbek @python_uz @swift_uzb —————— @uzdevgroup @UzGeeksGroup ——— @UzDev_Jobs @jobs_uzb