简体   繁体   English

替代Javascript函数中的弹出窗口警报

[英]Alterantive to popup window alert in Javascript function

I have an alert that lets the user know that their selection has refreshed. 我有一个警报,让用户知道他们的选择已刷新。 What I would like to know is how can I display the selection change in a text label instead of a popup alert window to indicate the environment is loading and the environment is loaded. 我想知道的是如何在文本标签中显示选择更改,而不是弹出警报窗口以指示环境正在加载并且环境已加载。 Thanks. 谢谢。

<section id="scripts">
<script type="text/javascript">
    $('#Areas').change(function ()
    {
        ****Help-Environment is loading***
        Application.Refresh();
                    ****Help-Environment is loaded***
    });
</script>
</section>

What you probably want to do is have an alert element on your page that defaults to display: none; 您可能想做的是在页面上有一个警报元素,默认display: none; , and then change it's content and display property on change. ,然后更改其内容并在更改时显示属性。

HTML 的HTML

<div id="alert" style="display: none;></div>

JS JS

$('#Areas').change(function ()
{
    var alert = $('#alert');
    alert.html('Your Selection Changed!');
    alert.show();
});

This is about as basic an example as possible and should be very easy to extend with some CSS+jQuery 这是一个尽可能基本的示例,并且应该很容易用一些CSS + jQuery进行扩展

Use jqModal or similar. 使用jqModal或类似的。 https://github.com/eyoosuf/jqModal It is designed for exactly this purpose. https://github.com/eyoosuf/jqModal正是为此目的而设计的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM