如何让Html获得Flex中的值

如何让Html获得Flex中的值,第1张

1,访问页面:a.html:

<html>

<head>

</head>

<body>

<input

type="text"

name="name"

id="name"

>

<input

type="button"

value="选择用户"

onclick="window.open('b.html','selectname',800,600,1)">

</body>

</html>

2,新打开的选择页面b.html

<html>

<head>

<script

type="text/javascript">

function

selectOrg(name){

if(window.opener){

window.opener.document.all.name.value

=name

window.close()

}

}

</script>

</head>

<body>

<input

type="radio"

name="name"

onclick="selectOrg('李四')">李四

<input

type="radio"

name="name"

onclick="selectOrg('张三')">张三

<input

type="radio"

name="name"

onclick="selectOrg('王五')">王五

</body>

</html>

试一下吧!

点击a.html中的"选择用户"按钮就会d出b.html,在b.html选择用户后就能返回到a.html并显示返回值

flex项目下修改html-template文件夹下的index.template.html模版文件。代码如下:

<script type="text/javascript">

// 隐藏富文本编辑器

function hideIFrame(){

  $('#iframediv').css('visibility','hidden')

}

// 显示富文本编辑器

function showIFrame(){

  $('#iframediv').css('visibility','visible')

  iframe.focus()

}

</script>

<div id="iframediv" style="position:absolutebackground-color:transparentborder:0pxvisibility:hiddenpadding-top:2px">

  <iframe id="iframe" name="iframe" src="http://file.xxxx.cn/ueditor.html" frameborder="0" style="padding:0px"></iframe>

</div>

在Flex中调用hideIFrame和showIFrame即可达到目的


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/6176277.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-17
下一篇 2023-03-17

发表评论

登录后才能评论

评论列表(0条)

保存