标签: toastr

Sticky toastr onclick事件的关闭按钮

有没有办法在用户点击通知或点击关闭按钮后执行操作?目前我可以使用options.onclick事件做第一个选项.但是我无法看到如何在关闭按钮上执行此操作.或者,有没有办法可以对通知淡出执行我的操作?

toastr.options = {
    "closeButton": true,
    "timeOut": "0",
    "extendedTimeOut": "0"
};
toastr.options.onclick = function () {
    console.log("Notification clicked");
};
toastr.success("Success, Whooo!!");
Run Code Online (Sandbox Code Playgroud)

jquery toastr

1
推荐指数
1
解决办法
1万
查看次数

未捕获的TypeError:X [g] .exec不是函数fb tokenize

从今天起我收到如下错误:

Uncaught TypeError: X[g].exec is not a function fb tokenize

这是堆栈跟踪:

Uncaught TypeError: X[g].exec is not a function fb.tokenize @ jquery.min.js:2 fb.compile @ jquery.min.js:2 fb.select @ jquery.min.js:2 fb @ jquery.min.js:2 m.event.handlers @ jquery.min.js:3 m.event.dispatch @ jquery.min.js:3 r.handle @ jquery.min.js:3

该项目是一个在.NET MVC区域内构建的Angularjs应用程序.依赖关系是:

编辑

似乎是Bootstrap.js文件的问题,其中警报应被解除但未找到.JQuery Sizzle找不到"[alert-dismiss]".fb是JQuery的缩小版本中的Sizzle.

typeerror twitter-bootstrap angularjs toastr angular-ui-bootstrap

1
推荐指数
1
解决办法
4908
查看次数

如何在toastr通知后重定向

我正在尝试在toastr通知完成显示后重定向.我目前有ajax请求

 $.ajax({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="_token"]').attr('value')
            },
            type: $(form).attr('method'),
            url: $(form).attr('action'),
            data: $(form).serialize(),
            dataType: 'json',
            success: function (data) {
                toastr.success('Hello','Your fun',{timeOut: 2000,preventDuplicates: true, positionClass:'toast-top-center'});


                     return window.location.href = '/';

            },
            error: function (data) {
                    var html = '<div class="alert alert-danger">Email/Password is invalid</div>';
                    $('#loginMsg').html(html);
            }
Run Code Online (Sandbox Code Playgroud)

问题是它显示通知但重定向到快速实际读取通知.如何在toastr通知隐藏后重定向?

jquery toastr

1
推荐指数
2
解决办法
5041
查看次数

Webpack 和 toastr

我正在尝试使用 webpack 加载和捆绑 toastr 作为依赖项。

这是整个 webpack 配置文件

var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var webpack = require('webpack');

const DEVELOPMENT = process.env.NODE_ENV === 'development';
const PRODUCTION = process.env.NODE_ENV === 'production';

module.exports = {
    entry: {
        main: './wwwroot/js/mainEntry.js',
        vendor: ['jquery', 'tether',
            'bootstrap', 'jquery-colorbox',
            'jquery-confirm', 'jquery-validation',
            'jquery-validation-unobtrusive',
            'toastr', 'jquery.nicescroll',]
    },
    output: {
        filename: '/js/[name].js',
        path: path.resolve(__dirname, 'wwwroot'),
    },
    module: {
        rules: [
            {
                test: /\.css$/,
                use: ExtractTextPlugin.extract({
                    fallback: "style-loader",
                    use: "css-loader"
                })
            },
            {
                test: /\.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
                loader: 'file-loader?name=[name].[ext]&publicPath=/fonts/&outputPath=/fonts/'
            },
            { …
Run Code Online (Sandbox Code Playgroud)

javascript toastr webpack webpack-2

0
推荐指数
1
解决办法
4498
查看次数