mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-08 00:56:52 +01:00
32 lines
644 B
JavaScript
32 lines
644 B
JavaScript
/**
|
|
* jQuery Yii plugin file.
|
|
*
|
|
* @author Qiang Xue <qiang.xue@gmail.com>
|
|
* @link http://www.yiiframework.com/
|
|
* @copyright Copyright © 2008 Yii Software LLC
|
|
* @license http://www.yiiframework.com/license/
|
|
* @version $Id$
|
|
*/
|
|
|
|
;(function($) {
|
|
|
|
$.yii = {
|
|
version : '1.0',
|
|
|
|
submitForm : function (element, url) {
|
|
var f = $(element).parents('form')[0];
|
|
if (!f) {
|
|
f = document.createElement('form');
|
|
f.style.display = 'none';
|
|
element.parentNode.appendChild(f);
|
|
f.method = 'POST';
|
|
};
|
|
if (typeof url == 'string' && url != '') {
|
|
f.action = url;
|
|
};
|
|
f.submit();
|
|
}
|
|
};
|
|
|
|
})(jQuery);
|