开发者

Colorbox - how to set data property to use POST instead of GET

I'm using the colorbox plugin and according to the docs, the data property allows submitting GET or POST values through an ajax request. I can submit my data via GET no problem, but can't figure out how to switch to POST. I'm using serialize to set the form data in name/value pairs. I have the code below:

开发者_运维百科

Is there a way to set this to POST?

var data = $('form').serialize();

            console.log(data);

            // Preview newsletter - bind colorbox to event
            $('a#preview').colorbox({
                width: '670px',
                href: $(this).attr('href'),
                data: data
            });

            return false;
        });


Use

 $('form').serializeArray();


The data property will act exactly like jQuery's .load() data argument, as ColorBox uses .load() for ajax handling.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜