小编Fun*_*end的帖子

BrowserSync无法获取/

我只用这个命令安装了NodeJS和BrowserSync:

npm install -g browser-sync 
Run Code Online (Sandbox Code Playgroud)

使用此命令启动服务器后:

C:\xampp\htdocs\browser_sync
? browser-sync start --server
[BS] Access URLs:
 --------------------------------------
       Local: http://localhost:3000
    External: http://192.168.1.223:3000
 --------------------------------------
          UI: http://localhost:3001
 UI External: http://192.168.1.223:3001
 --------------------------------------
[BS] Serving files from: ./
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:无法获取/

我很困惑,因为我想在我的Laravel项目中使用BrowserSync.

我应该在哪里安装BrowserSync?

谢谢.

node.js browser-sync

30
推荐指数
2
解决办法
4万
查看次数

在特定文件夹中启动cmder ConEmu控制台

我想在这条路线C:\ xampp\htdocs中启动我的Cmder控制台,但我不理解'任务参数'的语法.例如:

 `/icon "%CMDER_ROOT%\cmder.exe`"
Run Code Online (Sandbox Code Playgroud)

任何人都可以翻译吗?C:\xampp\htdocs to -> /icon "%CMDER_ROOT%\cmder.exe"

所以我可以编辑配置并放置我的自定义文件夹: 在此输入图像描述

非常感谢你.

windows cmd conemu cmder

29
推荐指数
4
解决办法
2万
查看次数

Sublime 3切换注释命令在Windows中不起作用

我编辑了文件Preferences> Key Bindings User,并添加了这个:

[
  { "keys": ["ctrl+/"], "command": "toggle_comment", "args": { "block": false } },
  { "keys": ["ctrl+shift+/"], "command": "toggle_comment", "args": { "block": true } }, 
]
Run Code Online (Sandbox Code Playgroud)

但快捷方式不起作用.什么地方出了错?

keyboard-shortcuts preferences sublimetext3

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

保证金自动失败IE11

如果您使用浏览器Chrome 检查我的网站,您可以看到div .bg-content的div如何正常使用此样式:

.bg-content {
    max-width: 605px;
    height: 149px;
    position: absolute;
    top: 62px;
    font-family: sans-serif;
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
}
Run Code Online (Sandbox Code Playgroud)

但是,如果您使用Internet Explorer 11打开我的网站,则div .bg-content不会居中,他会向左浮动.

我怎样才能解决这个问题?

html css internet-explorer-11

16
推荐指数
3
解决办法
2万
查看次数

检查数组中是否存在值(Laravel或Php)

我有这个数组:

$list_desings_ids = array('hc1wXBL7zCsdfMu','dhdsfHddfD','otheridshere');
Run Code Online (Sandbox Code Playgroud)

使用die()+ var_dumo()这个数组返回给我:

array:2 [?
  0 => "hc1wXBL7zCsdfMu"
  1 => "dhdsfHddfD"
  2 => "otheridshere"
]
Run Code Online (Sandbox Code Playgroud)

我想检查一下design_id是否在$ list_desings_ids数组中退出.

例如:

foreach($general_list_designs as $key_design=>$design) {
    #$desing->desing_id return me for example: hc1wXBL7zCsdfMu
    if(array_key_exists($design->design_id, $list_desings_ids))
    $final_designs[] = $design;
}
Run Code Online (Sandbox Code Playgroud)

但这对我不起作用,正确的方法是什么?

php arrays laravel

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

JavaScript"parseInt()"十进制字符串的问题

在使用toString函数后,我在电子商务网页的购物车代码中获得了total_amount,但是当我将14.82字符串转换为int数时,小数就会消失.

<script>
 var total_amount_string = <?=json_encode($cart['total_pvp'])?>;//-> 14,82
 var total_amount_int = parseInt(total_amount_string).toFixed(2); //-> 14.00(here is the error)

console.log(total_amount_string) //-> 14,82
console.log(total_amount_int) //-> 14.00
</script>
Run Code Online (Sandbox Code Playgroud)

怎么了?

javascript

10
推荐指数
2
解决办法
3万
查看次数

什么是.tpl.html文件?(angularjs)

我正在做一个angularjs博客教程,在代码示例中我看到这个新文件类型" tpl.html ":

$routeProvider
.when('/', {
templateUrl: 'views/post-list.tpl.html',
controller: 'PostListController',
controllerAs: 'postlist'
})
.when('/post/:postId', {
templateUrl: 'views/post-detail.tpl.html',
controller: 'PostDetailController',
controllerAs: 'postdetail'
})
.when('/new', {
templateUrl: 'views/post-create.tpl.html',
controller: 'PostCreateController',
controllerAs: 'postcreate'
});
Run Code Online (Sandbox Code Playgroud)

这个文件类型是什么?与html文件不同?

html angularjs

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

ERR_ADDRESS_UNREACHABLE在Chrome Android中打开我的本地主机

我正在使用Grunt的BrowserSync任务,这个任务将我的本地项目启动到url"localhost:3000".

在此输入图像描述

这很好用.但是当我在智能手机中使用外部网址(http://192.168.1.129:3000)时,我的浏览器Chrome在Android中出现以下错误:

ERR_ADDRESS_UNREACHABLE
Run Code Online (Sandbox Code Playgroud)

我不明白这个问题.你可以在这里看到我的Gruntfile.js:

//Gruntfile.js
module.exports = function (grunt) {
  grunt.initConfig({

    //Watch task config
    watch: {

    },
    //BrowserSync
    browserSync: {
      default_options: {
        bsFiles: {
          src: [
            "css/*.css",
            "js/*.js",
            "*.html"
          ]
        },
        options: {
          watchTask: true,
          proxy: "tutorialmaterialize.dev"
          }
        }
      }

    });

  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-browser-sync');

 //Default task
 grunt.registerTask('default', ['browserSync', 'watch']);
};
Run Code Online (Sandbox Code Playgroud)

我怎么能解决这个问题?非常感谢你.

javascript android google-chrome gruntjs browser-sync

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

Chrome Devtool不会在响应标头中显示Content-Encoding

我启用gzip压缩以提高Google PageSpeed Insights的速度:

如果压缩mantaspersonalizadas.com/fonts/Cocktail-Shaker.svg,将节省144.1 KB(减少65%).如果压缩mantaspersonalizadas.com/fonts/Cocktail-Shaker.ttf,将节省62.6 KB(减少49%).如果压缩mantaspersonalizadas.com/fonts/Cocktail-Shaker.woff,将节省2.6 KB(减少5%).

我使用Apache服务器,我将此代码添加到.htacess:

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/xml
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/opentype

# For Olders Browsers Which Can't Handle …
Run Code Online (Sandbox Code Playgroud)

.htaccess google-chrome mod-deflate pagespeed

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

XAMPP Apache将我的虚拟主机重定向到/ dashboard

我在Mac上的XAMPP中配置我的apache主机名和虚拟主机.

但是,当我访问主机URL时,xampp将我重定向到/ dashboard:mydomain.dev/dashboard

这是我的httpd-vhosts.conf:

# Virtual Hosts

<VirtualHost *:80>
    DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/web_frikinow/public"
    ServerName mydomain.dev
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

这是我的/ etc/hosts文件:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
127.0.0.1 mydomain.dev
127.0.0.1 Funny-Frontend # added by Apache Friends XAMPP
Run Code Online (Sandbox Code Playgroud)

什么是问题?

php apache

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