Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.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插件插入MEAN.js代码库_Javascript_Jquery_Mean Stack - Fatal编程技术网

Javascript 在何处将jQuery插件插入MEAN.js代码库

Javascript 在何处将jQuery插件插入MEAN.js代码库,javascript,jquery,mean-stack,Javascript,Jquery,Mean Stack,我用MEAN.js开发了几个静态页面。我试图将jQuery Lightbox插件添加到我的项目中。 jQuery Lightbox插件有jQuery.Lightbox.js和jQuery.Lightbox.css 你能告诉我这些文件应该放在哪里吗? 我试图放入/public/dist文件夹,但服务器无法加载js和css文件。您需要类似的内容,但如果这些脚本与html文件不在同一目录中,则需要重写脚本的URL。当然,如果您使用的是其他版本的jQuery,那么也需要重写该文件名 <!DOCTY

我用MEAN.js开发了几个静态页面。我试图将jQuery Lightbox插件添加到我的项目中。 jQuery Lightbox插件有jQuery.Lightbox.js和jQuery.Lightbox.css

你能告诉我这些文件应该放在哪里吗?
我试图放入/public/dist文件夹,但服务器无法加载js和css文件。

您需要类似的内容,但如果这些脚本与html文件不在同一目录中,则需要重写脚本的URL。当然,如果您使用的是其他版本的jQuery,那么也需要重写该文件名

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="jQuery.lightbox.css" type="text/css">
        <script src="jquery-1.11.0.min.js" type="text/javascript"></script>
        <script src=" jQuery.lightbox.js" type="text/javascript"></script>
        <script type="text/javascript" src="MEAN.js"></script>
    </head>
    <body>

    </body>
</html>

请检查:

您需要类似的内容,但如果脚本与html文件不在同一目录中,则需要重写脚本的URL。当然,如果您使用的是其他版本的jQuery,那么也需要重写该文件名

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="jQuery.lightbox.css" type="text/css">
        <script src="jquery-1.11.0.min.js" type="text/javascript"></script>
        <script src=" jQuery.lightbox.js" type="text/javascript"></script>
        <script type="text/javascript" src="MEAN.js"></script>
    </head>
    <body>

    </body>
</html>

请检查:

您可能需要查看配置文件夹下的内容。config文件夹包含配置应用程序所需的文件


Css、js和其他资产都在/config/env/all.js中调用,您可能需要在config文件夹下查看。config文件夹包含配置应用程序所需的文件


Css、js和其他资产都在/config/env/all.js中调用,您必须在客户端路由中添加:modules/application module/client/config/client.routes.js。请参阅以下代码

    .state('dashboards.dashboard_2', {
        url: "/dashboard_2",
        templateUrl: "views/dashboard_2.html",
        data: { pageTitle: 'Dashboard 2' },
        resolve: {
            loadPlugin: function ($ocLazyLoad) {
                return $ocLazyLoad.load([
                    {
                        serie: true,
                        name: 'angular-flot',
                        files: [ 'js/plugins/flot/jquery.flot.js', 'js/plugins/flot/jquery.flot.time.js', 'js/plugins/flot/jquery.flot.tooltip.min.js', 'js/plugins/flot/jquery.flot.spline.js', 'js/plugins/flot/jquery.flot.resize.js', 'js/plugins/flot/jquery.flot.pie.js', 'js/plugins/flot/curvedLines.js', 'js/plugins/flot/angular-flot.js' ]
                    },
                    {
                        serie: true,
                        files: ['js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js', 'js/plugins/jvectormap/jquery-jvectormap-2.0.2.css']
                    },
                    {
                        serie: true,
                        files: ['js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js']
                    },
                    {
                        name: 'ui.checkbox',
                        files: ['js/bootstrap/angular-bootstrap-checkbox.js']
                    }
                ]);
            }
        }
    })

您必须在客户端路由中添加:modules/application module/client/config/client.routes.js。请参阅以下代码

    .state('dashboards.dashboard_2', {
        url: "/dashboard_2",
        templateUrl: "views/dashboard_2.html",
        data: { pageTitle: 'Dashboard 2' },
        resolve: {
            loadPlugin: function ($ocLazyLoad) {
                return $ocLazyLoad.load([
                    {
                        serie: true,
                        name: 'angular-flot',
                        files: [ 'js/plugins/flot/jquery.flot.js', 'js/plugins/flot/jquery.flot.time.js', 'js/plugins/flot/jquery.flot.tooltip.min.js', 'js/plugins/flot/jquery.flot.spline.js', 'js/plugins/flot/jquery.flot.resize.js', 'js/plugins/flot/jquery.flot.pie.js', 'js/plugins/flot/curvedLines.js', 'js/plugins/flot/angular-flot.js' ]
                    },
                    {
                        serie: true,
                        files: ['js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js', 'js/plugins/jvectormap/jquery-jvectormap-2.0.2.css']
                    },
                    {
                        serie: true,
                        files: ['js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js']
                    },
                    {
                        name: 'ui.checkbox',
                        files: ['js/bootstrap/angular-bootstrap-checkbox.js']
                    }
                ]);
            }
        }
    })

您还必须将它们包括在html中,而不仅仅是在文件系统中签出,可能会有帮助:您还必须将它们包括在html中,而不仅仅是在文件系统中签出,可能会有帮助: