Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.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 当用户登录到页面时,如何在jsp程序中为angular toastr编写代码_Javascript_Angular_Ajax_Jsp_Toastr - Fatal编程技术网

Javascript 当用户登录到页面时,如何在jsp程序中为angular toastr编写代码

Javascript 当用户登录到页面时,如何在jsp程序中为angular toastr编写代码,javascript,angular,ajax,jsp,toastr,Javascript,Angular,Ajax,Jsp,Toastr,Hai如何在jsp java编程中编写angulartoaster的代码我试图将会话用户名打印到angulartoaster中,但我得到了用户的值,没有在angulartoaster上打印用户名,也没有打开angulartoaster弹出窗口。这是我的密码,请帮我 <link href="assets/libs/toastr/toastr.min.css" rel="stylesheet" type="text/css" /&g

Hai如何在jsp java编程中编写angulartoaster的代码我试图将会话用户名打印到angulartoaster中,但我得到了用户的值,没有在angulartoaster上打印用户名,也没有打开angulartoaster弹出窗口。这是我的密码,请帮我

 <link href="assets/libs/toastr/toastr.min.css" rel="stylesheet" type="text/css" />     
    <script type="text/javascript">

toastr.options = {
  "closeButton": false,
  "debug": false,
  "newestOnTop": false,
  "progressBar": false,
  "positionClass": "toast-top-right",
  "preventDuplicates": false,
  "onclick": null,
  "showDuration": "300",
  "hideDuration": "1000",
  "timeOut": "5000",
  "extendedTimeOut": "1000",
  "showEasing": "swing",
  "hideEasing": "linear",
  "showMethod": "fadeIn",
  "hideMethod": "fadeOut"
};
        var Msg ='<%=session.getAttribute("UserName")%>';
        if (Msg !== "null") 
        {
        function alertName()
        {
            toastr.options.positionClass = 'toast-bottom-right';
            toastr.success("Welcome!"+Msg);
            //alert("Welcome");
        } 
        } 
        
 </script>
<script type="text/javascript"> window.onload = alertName; </script>```

toastr.options={
“closeButton”:false,
“调试”:错误,
“newestOnTop”:错误,
“progressBar”:错误,
“positionClass”:“右上角烤面包”,
“防止重复”:错误,
“onclick”:空,
“showDuration”:“300”,
“隐藏”:“1000”,
“超时”:“5000”,
“extendedTimeOut”:“1000”,
“挥杆”:“挥杆”,
“隐藏”:“线性”,
“showMethod”:“fadeIn”,
“隐藏法”:“淡出”
};
var Msg='';
如果(消息!=“空”)
{
函数alertName()
{
toastr.options.positionClass='toast bottom right';
toastr.success(“欢迎!”+Msg);
//警惕(“欢迎”);
} 
} 
window.onload=alertName```

Hi,请确保您已经导入了所需的CDN,如果语句不在内部,则函数应该在外部。这里正在运行