获取layer.open弹出层的返回值

获取layer弹出框的返回值 之前的一篇blog获取URL参数, 讲解了点“选择供应商”按钮,弹出选择供应商页面,在弹出选择供应商页面,如何获取url的参数。那么在弹出页面点确认按钮,如可将选中的信息返回到父页面呢? 阅读详情
layer.open({
                    type: 2,
                    title: "设置围栏",
                    shadeClose: true,
                    shade: 0.4,
                    area: ['90%', '90%'],
                    content: "/ElectronicFence/Map?id=" + id + "&shapeType=" + shapeType,
                    btn: ['确定','关闭'],
                    yes: function(index){
                        //当点击‘确定’按钮的时候,获取弹出层返回的值
                        var res = window["layui-layer-iframe" + index].callbackdata();
                        //打印返回的值,看是否有我们想返回的值。
                        console.log(res);
                        //最后关闭弹出层
                        layer.close(index);
                    },
                    cancel: function(){
                        //右上角关闭回调
                    }
                });

注意:

var res = window["layui-layer-iframe" + index].callbackdata();
这行代码中‘callbackdata’是弹出层里面定义的函数。也许我们知道了什么!这个函数的作用就是返回值。
<script>
 var callbackdata = function () {
            var data = {
                username: 'zhangfj'
            };
            return data;
        }
    </script>

上面的代码就是弹出层里面的JavaScript代码,里面定义了函数'callbackdata' 用来返回值给调用弹出层的页面。

 



获取layer.open弹出层的返回值方法 今天小编就为大家分享一篇获取layer.open弹出层的返回值方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧 立即下载

相关推荐

layer父页获取弹出层输入框里面的值方法

今天小编就为大家分享一篇layer父页获取弹出层输入框里面的值方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧

html页面弹出框返回值,获取layer.open弹出层的返回值_jquery_弹出窗口

获取lay朋不功事做时次功好来多这开制的请一例农在er.open弹出层的返回是能览调不页新代些事几求事都时学下是事值Layer:如何调用layer.open打开的的iframe窗口中的JS?layer.open({type: 2,content: 'test/iframe.html',success: function(layero, index){var body = layer.getChil...

weixin_39517859的博客 692

layer.open回调获取弹出层参数的实现方法

如下所示: layer.open({ type : 2, title : '重命名', maxmin : true, shadeClose : true, // 点击遮罩关闭层 area : [ '200px', '150px' ], content : getContext() + /node/torenamenode?nodeName=+nodeName, btn: ['确定'], yes: function(index, layero){ //do something/ /callbackdata是弹出层的方法,返回参数 var node

Layer:如何调用layer.open打开的的iframe窗口中的JS?

layer.open({type: 2,content: 'test/iframe.html',success: function(layero, index){  var body = layer.getChildFrame('body', index);  var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页...

weixin_30823833的博客 513

layui 弹出层回调获取弹出层数据的例子

如下所示: // 弹出楼栋负责人信息页面 layer.open({ type: 2, title:'请选择楼栋负责人', maxmin: false, area: ['60%', '80%'], offset: '0px', content: '${ctx}/life/houserInsertion/headBuildingInfo?pkProject='+pkProject,\n btn: ['确定','关闭'], yes: function(index){ //当点击‘确定'按钮的时候,获取弹出层返回的值 var res

yolo自动化项目实例解析(九) 导航

比如我们经常使用的导航,说白了就是寻找两点之间最近的路径,也就是所谓的寻路,我们需要想办法让程序知道他要去哪里,路径包含(起点、轨迹、路径)

默子昂 1996

layer获取弹出的html怎么获取值,获取layer.open弹出层的返回值方法

正在开发的车联网项目用到了layer API。当我在开发“新建电子围栏”的时候需要弹出地图,用户在地图中画一个区域,最后将这个弹出层的数据返回给原页面。下面是我的实现过:程:触发弹出层的代码:layer.open({type: 2,title: "设置围栏",shadeClose: true,shade: 0.4,area: ['90%', '90%'],content: "/Electronic...

weixin_34138014的博客 1805

VBOX 3iS实战:如何用GNSS+IMU搞定车辆动态坡度测量(附避坑指南)

本文详细介绍了VBOX 3iS在车辆动态坡度测量中的高阶应用,通过GNSS+IMU融合技术和卡尔曼滤波算法,有效解决了传统测量方法在动态环境中的局限性。文章提供了设备配置、实战策略和数据后处理的实用指南,帮助工程师提升测量精度和效率。

weixin_42520796的博客 321

获取layer.open弹出层的返回值 jquery 弹出窗口

获取layer.open弹出层的返回值 Layer:如何调用layer.open打开的的iframe窗口中的JS? layer.open({ type: 2, content: 'test/iframe.html', success: function(layero, index){   var body = layer.getChildFrame('body', index);   var ...

AI 前沿技术实战博客:LLM / Agent / AI 制药 / 生信四大栏目日更,硬核干货 + 可复现代码,看完就能上手 3198

深度解析direct path write temp与ASM IO性能问题:Oracle 19.17视图查询优化指南

本文深度解析了Oracle 19.17版本中复杂视图查询出现`direct path write temp`与`ASM IO for non-blocking poll`性能瓶颈的根本原因。通过对比11.2.0.4版本的执行计划差异,文章提供了从CBO参数调整、存储层优化到SQL架构重构的完整实战调优指南,帮助DBA有效解决升级后的查询性能问题。

2y3u4i5o6p的博客 1100

霍尔安装歪了也能用?揭秘无感FOC中的‘霍尔自学习’黑科技,实现信号线自适应

本文揭秘了无感FOC中的‘霍尔自学习’黑科技,即使霍尔安装歪了或信号线接错,电机仍能平稳运转。该技术通过算法创新解决了传统霍尔方案的安装公差、接线容错和校准成本问题,显著提升了电机控制的可靠性和效率。文章详细解析了自学习算法的实现架构、关键技术及工程实践中的优化方案,展示了其在工业应用中的卓越性能。

weixin_28309571的博客 463

怎么获取layer中的表单值_layer获取弹出frame层数据

通常,弹出层关闭之前,需要将部分数据传入父页面。这个时候怎么办呢?通过success获取frame层的index。然后通过cancel事件,获取子页面数据。拿获取高德地图坐标为例:// 显示地图,设置坐标function showMap() {var tmpIndex = '';layer.open({type: 2,title: '获取店铺坐标与地址',shadeClose: true,shad...

weixin_39546312的博客 1749

【Cubietruck】Qt5.8.0 x64、x86、armhf三个版本的编译安装

一、       Preparation 以下环境配置支持虚拟机和实体机,但是实体机生产效率会相对高一点,实体机编译Qt的速度是虚拟机两倍以上。 若使用虚拟机,推荐使用VirtualBox,开源免费,尽量不要使用Vmware破解版。   Download List   名称 链接 下载项目 OS https://mirro

beatfan的博客 3658

layUI关闭指定弹出层

<script type="text/javascript"> layui.use(['layer'],function () { var layer = layui.layer; var load = layer.load(1, { shade: [0.1,'#fff'], time: 2000 ...

蚂蚁的博客 1964

YOLOv8融合可变形注意力(DAT)实战教程:暴力涨点的科研级注意力机制优化方案

DAT的“可变形注意力”为目标检测的“精准特征捕捉”提供了全新思路,而YOLOv8的工程化优势让这种科研创新能快速落地到工业场景。希望这篇教程能帮你在“注意力机制优化+复杂场景检测”的痛点上找到突破口。如果你在实操中遇到“涨点不明显”的问题,不妨回到“DAT的采样点是否贴合目标形状”“注意力权重是否有效过滤背景”这些细节上找原因——科研的价值,就在于在细节打磨中推动技术进步。祝你在DAT与YOLOv8的结合探索中,既能做出有说服力的实验成果,又能沉淀出解决异形目标检测难题的实用经验。

know_F0727的博客 83

基于深度学习的商品标签识别系统:UI界面 + YOLOv8/v7/v6/v5代码 + 训练数据集

基于YOLO系列模型的商品标签识别系统能够有效解决商品信息提取的自动化问题。通过合理的数据集准备、模型训练和UI设计,我们可以实现一个功能强大的商品标签识别系统。希望本文提供的内容能够为大家提供有价值的帮助。

YOLO 474

asp.net中获取Layer弹出层返回值

1、MainPage.aspx中点击按钮利用Layer弹出层,代码如下: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainPage.aspx.cs" Inherits=...

weixin_34029680的博客 201

基于MATLAB的井筒多相流模拟

井筒多相流的模拟可以基于不同的数学模型和计算方法。其中,最常用的模型之一是多相流模型,它基于质量守恒、动量守恒和能量守恒等原理,描述了流体在井筒中的流动行为。对于井筒多相流的模拟和分析可以帮助我们理解和优化油气田开发过程中的流体行为,从而提高产量和效率。在本文中,我们将介绍如何使用MATLAB进行井筒多相流的模拟,并提供相应的源代码。需要注意的是,以上示例是一个简化的模拟,仅用于演示如何使用MATLAB进行井筒多相流模拟。实际应用中,我们需要考虑更多的物理过程和参数,并使用更复杂的数值方法和模型进行模拟。

AtdiHtml的博客 706

layer.open属性详解及layer.open弹出框使用post方法

layer弹窗

yangyang_VV的博客 3万+

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

layer.open弹出层的回调(返回值)

获取layer.open弹出层的返回值 layer.open({ type: 2, title: "设置围栏", shadeClose: true, shade: 0.4, are...

asd523500的博客 5398

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

layer弹出层的使用——访问另外一个页面,进行数据交互

1、在父页面中点击按钮之后弹出一个框,里面加载另一个页面,称之为子页面 layer.open({ title: '新增', type: 2,//很关键,只有type=2时,才会访问其他页面,否则以字符串的格式显示 content: '../add.html?a=1&b=2&c=3 ',//问号后面向子页面传递参数,可以多个 area: ['800px', '60...

qq_37014541的博客 4571

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

layUI弹出层回调获取弹出层数据

//隐患选择弹出框 function func12(url, title) { //iframe层 layer.open({ type: 2, skin: 'layui-layer-lan', title: title, ...

qq_43128070的博客 1792
上一篇: typeahead 数据处理
下一篇: Windows10远程报错:由于CredSSP加密Oracle修正
Farmwang
博客等级 码龄12年 547粉丝 595原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值