layer get method 支持 contentFormData 参数
This commit is contained in:
@@ -307,7 +307,7 @@ Class.pt.creat = function(){
|
|||||||
// + config.content[0] + '"></iframe>';
|
// + config.content[0] + '"></iframe>';
|
||||||
// 2017-5-13 ThinkGem 支持post方式提交iframe
|
// 2017-5-13 ThinkGem 支持post方式提交iframe
|
||||||
config.content = '<iframe scrolling="'+ (config.content[1]||'auto') +'" allowtransparency="true" id="'
|
config.content = '<iframe scrolling="'+ (config.content[1]||'auto') +'" allowtransparency="true" id="'
|
||||||
+ doms[4] +''+ times +'" name="'+ doms[4] +''+ times
|
+ doms[4] + times +'" name="'+ doms[4] +''+ times
|
||||||
+ '" onload="this.className=\'\';" class="layui-layer-load" frameborder="0"></iframe><form id="'
|
+ '" onload="this.className=\'\';" class="layui-layer-load" frameborder="0"></iframe><form id="'
|
||||||
+ doms[4] + '-form' + times+'" action="' + config.content[0] + '" method="post" target="'
|
+ doms[4] + '-form' + times+'" action="' + config.content[0] + '" method="post" target="'
|
||||||
+ doms[4] + '' + times +'"></form>';
|
+ doms[4] + '' + times +'"></form>';
|
||||||
@@ -357,7 +357,12 @@ Class.pt.creat = function(){
|
|||||||
// 2017-5-13 ThinkGem 支持post方式提交iframe
|
// 2017-5-13 ThinkGem 支持post方式提交iframe
|
||||||
if (config.type == 2){
|
if (config.type == 2){
|
||||||
if (config.method == 'GET' || config.method == 'get'){
|
if (config.method == 'GET' || config.method == 'get'){
|
||||||
that.layero.find('iframe').attr('src', content[0]);
|
var iframeSrc = content[0] || '', formData = config.contentFormData;
|
||||||
|
for(var key in formData || {}){
|
||||||
|
iframeSrc += iframeSrc.indexOf('?') == -1 ? '?' : '&';
|
||||||
|
iframeSrc += key + '=' + formData[key];
|
||||||
|
}
|
||||||
|
that.layero.find('#' + doms[4] + times).attr('src', iframeSrc);
|
||||||
}else{
|
}else{
|
||||||
var form = that.layero.find('#' + doms[4] + '-form' + times), formData = config.contentFormData;
|
var form = that.layero.find('#' + doms[4] + '-form' + times), formData = config.contentFormData;
|
||||||
for(var key in formData || {}){
|
for(var key in formData || {}){
|
||||||
|
|||||||
Reference in New Issue
Block a user