Home JS special effects CSS3 special effects FormData image upload plug-in implemented by CSS3

FormData image upload plug-in implemented by CSS3

FormData image upload plug-in implemented by CSS3

FormData image upload plug-in implemented by CSS3

js code

<script src="js/jquery.min.js"></script>
<script src="js/bootstrap-fileinput.js"></script>
<script type="text/javascript">
    $(function () {
        //比较简洁,细节可自行完善
        $('#uploadSubmit').click(function () {
            var data = new FormData($('#uploadForm')[0]);
            $.ajax({
                url: 'xxx/xxx',
                type: 'POST',
                data: data,
                async: false,
                cache: false,
                contentType: false,
                processData: false,
                success: function (data) {
                    console.log(data);
                    if(data.status){
                        console.log('upload success');
                    }else{
                        console.log(data.message);
                    }
                },
                error: function (data) {
                    console.log(data.status);
                }
            });
        });

    })

</script>

这是一款基于Bootstrap和fileinput.js实现的FormData图片上传插件,还可以实时预览。

Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

Image grouping switching focus image plug-in implemented by jQuery_jquery Image grouping switching focus image plug-in implemented by jQuery_jquery

16 May 2016

This article mainly introduces the image grouping switching focus image plug-in implemented by jQuery. The effect is very good and very practical. It is recommended to friends in need.

How to skillfully use CSS3 special effects to improve the user experience of web pages How to skillfully use CSS3 special effects to improve the user experience of web pages

09 Sep 2023

How to skillfully use CSS3 special effects to improve the user experience of web pages. With the development of the Internet, web design and user experience have become important links in website development. The application of CSS3 special effects can add dynamics and visual effects to web pages and improve user experience. This article will introduce several common CSS3 special effects and their code examples to help developers become more proficient in using CSS3 special effects and improve the user experience of web pages. Transition effect (Transition) Transition effect is one of the most basic special effects in CSS3. By changing a certain attribute

Image and text automatic carousel effect plug-in implemented by JQuery_jquery Image and text automatic carousel effect plug-in implemented by JQuery_jquery

16 May 2016

This article mainly introduces the automatic image and text carousel effect plug-in implemented by JQuery, involving jQuery's method of processing mouse events and animation effects. Friends who need it can refer to it.

Image and text automatic carousel effect plug-in implemented by JQuery Image and text automatic carousel effect plug-in implemented by JQuery

28 Jun 2018

This article mainly introduces the automatic image and text carousel effect plug-in implemented by JQuery, involving jQuery's method of processing mouse events and animation effects. Friends who need it can refer to it.

Implementation of css3 visual effects Implementation of css3 visual effects

22 Mar 2018

This time I will bring you the implementation of CSS3 visual special effects. What are the precautions for realizing CSS3 visual special effects? The following is a practical case, let’s take a look.

Sharing of 7 eye-catching jQuery/CSS3 special effects examples_jquery Sharing of 7 eye-catching jQuery/CSS3 special effects examples_jquery

16 May 2016

jQuery and CSS3 are definitely used a lot for web front-end development. Next, I will share some special effects made by jQuery and CSS3. I hope it will be helpful to friends who like to learn special effects.

How to use css3 to achieve 3D stereoscopic effects How to use css3 to achieve 3D stereoscopic effects

14 Mar 2018

This time I will show you how to use css3 to achieve 3D stereoscopic special effects. What are the precautions for using css3 to achieve 3D stereoscopic special effects? The following is a practical case, let’s take a look.

CSS3 3D special effects video data sharing CSS3 3D special effects video data sharing

31 Aug 2017

"CSS3 3D Special Effects Video Tutorial" uses the transition attribute, perspective attribute, and transform attribute in CSS3 to create real and usable three-dimensional effects.

Various special effects of filter in css3 Various special effects of filter in css3

09 Oct 2016

Various special effects of filter in css3

See all articles See all articles

Hot Tools

CSS text is combined into a heart-shaped animation special effect

CSS text is combined into a heart-shaped animation special effect

CSS text is combined into a heart-shaped animation special effect

CSS3 SVG expression flower animation special effects

CSS3 SVG expression flower animation special effects

SS3 SVG confession flower animation special effect is a Valentine's Day animation special effect.

CSS shopping mall websites commonly use left category drop-down navigation menu code

CSS shopping mall websites commonly use left category drop-down navigation menu code

CSS shopping mall websites commonly use left category drop-down navigation menu code

jQuery+CSS3 Valentine's Day love special effects

jQuery+CSS3 Valentine's Day love special effects

jQuery+CSS3 Valentine's Day Love Special Effect is a Valentine's Day hanging swinging heart animation special effect.

css3 spoon scooping up glutinous rice balls animation special effects

css3 spoon scooping up glutinous rice balls animation special effects

A bowl of cute glutinous rice balls expression, a spoon scooping up a glutinous rice balls animation special effects