更新面板和模式窗口
update panel and modal windows
我有我的mainpage.aspx,然后是我的mainDetails.ascx
/*As well as this javascript:*/
$(document).ready(function() {
$("#modal-close").click(function() {
$("#modal-content, #modal-background, #modal-close").toggleClass("active");
});
$("#keywordSelection").click(function() {
alert('hit');
});
});
/*mainDetails.ascx is an `asp:UpdatePanel` this contains the following javascript:*/
function jsModal() {
$("#keywordSearch").click(function() {
//alert('hi');
$("#modal-content, #modal-background, #modal-close").toggleClass("active");
//$("#modal-content").$("divTestVal").append.html
var html = $("#modal-content").next("#divTestVal").html();
alert(html);
});
}
<!-- mainpage.aspx is a web form that contains the following:-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="modal-background"></div>
<div id="modal-content">
<input type="button" id="modal-close" value="Close Modal Window" />
<br />
<div id="divTestVal">
[Append Values Here!]
</div>
<br />
<input type="button" id="keywordSelection" value="Selector!" />
</div>
我需要的是一种从模态中填充和读取值的方法。现在html变量正在返回null
。
如何从模态中获取[Append Values Here!]
值?
我找到了一种方法。
在mainDetail.ascx javascript中,我添加了以下内容:
$('#modal-content div').each(function (index) {
alert($(this).text());
$(this).html("updated text now");
});
这不仅在mainpage.aspx上的模态窗口中循环遍历每个div,而且还会更新div中的文本值。
相关文章:
- Angular$scope在模式窗口内不起作用
- 更改不在引导模式窗口中工作的月份和年份
- TinyMCE全屏不允许出现模式窗口
- 自动模式窗口?/欢迎弹出框
- 推特Boostrap模式窗口-可拖动不工作
- Twitter Boostrap:模式窗口在重新播放模式窗口后不播放视频
- 在Bootstrap模式窗口中打开远程内容
- jQuery模式窗口在内容为“”时不居中;注入“;在飞行中
- 如何在模式窗口弹出窗口中隐藏滚动条
- fancybox将内容更改为模式窗口
- 将值传递给模式窗口中的 JavaScript 函数
- HTML 瞬态模式窗口
- 具有 UI 引导模式窗口的父$scope子
- 如何将参数传递到 UI 路由器状态的模式窗口
- 如何使用引导程序创建模式窗口
- j查询模式窗口,刷新父问题
- 无法将引导模式窗口作为路由打开
- 如何使模式窗口打开动态内容并更改url
- 在引导模式窗口内路由
- 更新面板和模式窗口