Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/417.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何设置jquery ui对话框显示_Javascript_Jquery_Jquery Ui_Alert_Jquery Ui Dialog - Fatal编程技术网

Javascript 如何设置jquery ui对话框显示

Javascript 如何设置jquery ui对话框显示,javascript,jquery,jquery-ui,alert,jquery-ui-dialog,Javascript,Jquery,Jquery Ui,Alert,Jquery Ui Dialog,我在表单中有代码 不提交任何东西: 提交:My Content alert 我是用户代码: $( ".screen-reader-response" ).dialog(); 问题:当我不提交任何东西是:回声对话框没有内容 如何设置: 如果:不提交任何内容:无回音警报 如果:已提交:My Content alertecho alertMy Content alert 给我一些想法 访问我的网站:不提交时始终显示对话框内容?不提交时: $(".screen-reader-response").

我在表单中有代码

  • 不提交任何东西:
  • 提交:
    My Content alert
我是用户代码:

$( ".screen-reader-response" ).dialog();
问题:当我不提交任何东西是:回声对话框没有内容

如何设置:

如果:不提交任何内容:
无回音警报 如果:已提交:
My Content alert
echo alert
My Content alert

给我一些想法


访问我的网站:不提交时始终显示对话框内容?

不提交时:

$(".screen-reader-response").html("").dialog('open');
$(".screen-reader-response").html("My Content alert").dialog('open');    
提交时:

$(".screen-reader-response").html("").dialog('open');
$(".screen-reader-response").html("My Content alert").dialog('open');    

要使用更多选项初始化对话框,请查看jquery对话框的文档:

澄清您的问题,并以JSFIDLE为例说明如何在JSFIDLE中运行jquery ui?不提交任何东西:提交:我正在使用
$(“.screen reader response”).dialog()已运行,但如果#MyDialogy中没有内容,则不希望运行是的,我已更新代码。请检查一下。我想这就是你想要的。我正在添加代码:当没有提交=>没有回音对话框(true)-但当我是sumit=>没有回音对话框(false)???
$(“.screen reader response”).html(“我的内容警报”).dialog('open')如果
html(“我的内容警报”)
没有一个值??如何打开?对于我在回答中提到的权利,当没有提交。