jquery,更改网页中ajax调用的jqueryui对话框内容
jquery, change jqueryui dialog box content from a ajax call in the webpage
jqueryui用于显示一个对话框,如果在对话框上而不是在平面(正确的措辞?)网页上单击"dialog_insider",则会进行ajax调用。中的文件通过ajax调用html:
<div id="dialog" style="border:1px solid green; width:150px; margin:auto;">
<div class="dialog_insider">this is the dialog</div>
<!-- end of class dialog_insider-->
</div>
<!- end of id dialog-->
jquery:
<script type="text/javascript">
$(document).ready(function(){
$("#dialog").click(function(){
my_dialog = $(this).clone();
my_dialog.dialog();
$(".dialog_insider", my_dialog).click(function(){
alert("clicked");
$.post("replace.php",function(response){
});
});
});
});
</script>
文件replace.php包含:
<script type="text/javascript">
$(document).ready(function(){
alert("hi");
$("dialog_insider",my_dialog).html('4444444');
});
</script>
我没有从replace.php页面获得任何功能(即没有警报,没有html更改)
我尝试使用$("opener.dialog_insider",my_dialog).html('4444444');
,但没有结果。
解决方案是什么?
要使ajax中的javascript调用页面运行,需要将其附加到当前文档中。
当您进行AXAJ调用时,opener
将不起作用,只能在打开窗口的情况下起作用。
$.post("replace.php", {}, function(response){
$('body').append(response);
});
JS将在您附加它时执行,或者使eval()
;
相关文章:
- JqueryUI对话框没有'不能使用特定的输入名称
- 单击jqueryui对话框中的链接
- 动态覆盖jqueryUI对话框按钮(保存,取消等到用户选择)文本
- jqueryui 对话框变为灰色屏幕
- jQueryUI 对话框错误
- jqueryui对话框无法在firefox 11中“select()”输入
- 带有Ajax表单的jQueryUI对话框获胜't用$(this).对话框关闭(“关闭”);
- 在jQueryUI对话框中显示和格式化数组元素
- 当您单击关闭按钮时,jQueryUI对话框会重新加载页面.出了什么问题
- 如何在JQueryUI对话框中使加载ajax的UL可排序
- jQueryUI对话框带有使用回调的动态按钮
- 如何使jqueryui对话框没有关闭按钮
- jqueryui对话框(带输入)不破坏
- jqueryui对话框,打开新对话框并关闭后面的对话框
- jquery,更改网页中ajax调用的jqueryui对话框内容
- 如何在JqueryUI对话框关闭时对其执行回调
- JQueryUI对话框:延迟打开,直到成功加载幻灯片
- 保持jQueryUI对话框内容可见,为对话框内容添加新维度
- 如何在对话框内部内容增加时将按钮固定到jQueryUI对话框底部
- 关闭JQueryUI对话框只能工作一次