小编oli*_*ier的帖子

错误:侦听EACCES 0.0.0.0:80 OSx Node.js

我正在按照angularJS书中的教程进行操作,并且必须设置服务器.这是server.js文件:

 var express = require('express');
  var app = express();
   app.use('/', express.static('./'));
    app.listen(80);
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

$ node server.js
events.js:154
      throw er; // Unhandled 'error' event
      ^

Error: listen EACCES 0.0.0.0:80
Run Code Online (Sandbox Code Playgroud)

我已经知道,错误EACCES意味着我没有端口80的访问权限,但我不知道如何解决这个问题.任何帮助非常感谢!

javascript macos node.js

58
推荐指数
3
解决办法
6万
查看次数

未捕获的SecurityError:无法在"历史记录"上执行"replaceState":无法在原点为"null"的文档中创建

我真的没有得到这个chrome错误:

未捕获的SecurityError:无法在"历史记录"上执行"replaceState":无法在原点为"null"的文档中创建

在Edge,Firefox和IE中没有错误.

我使用jquery 1.11.1和jquery mobile 1.4.5.

这是我的索引文件:

<!DOCTYPE html>
<html>
<head>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" href="css/xy.min.css" />
    <link rel="stylesheet" href="css/jquery.mobile.icons.min.css" />
    <link rel="stylesheet" href="css/jquery.mobile.structure-1.4.5.min.css" />

    <title></title>

</head>

<body>
    <div data-role="page">
       <div data-role="header" data-add-back-btn="true">
           <p align="center">Test</p>
       </div>

        <ul data-role="listview" data-filter="true" data-filter-placeholder="Kategorie suchen"  data-inset="true" data-count-theme="b">
            <li><a href="assets/beck/index.html" data-rel"dialog" rel ="external">Bäckereien </a></li>
        </ul>

    </div>
    <script src="js/jquery-1.11.1.min.js"></script>
    <script src="js/jquery.mobile-1.4.5.min.js"></script>
</body>

</html>
Run Code Online (Sandbox Code Playgroud)

任何帮助非常感谢!

javascript jquery google-chrome jquery-mobile

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

在JavaScript中使用Regex删除下划线

就像标题所说,我想用正则表达式删除字符串中的下划线.这就是我所拥有的:

  function palindrome(str) {

     str = str.toLowerCase().replace(/[^a-zA-Z]/g, '',/\s/g, '',/[0-9]/g,'');  
        if (str.split("").reverse().join("") !== str) {
           return false;
        }
        else {
           return true;
        }
   }
palindrome("eye");
Run Code Online (Sandbox Code Playgroud)

javascript regex

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

在显示pdf时,是否可以在UIwebview中删除["Page 1 of 20"视图]?

经过多次谷歌搜索后,我无法找到解决方案.我有一个带有PDF的UIWebView.

我不想要视图:"第1页,共20页"查看PDF文件时左上角的小视图.有可能删除这个吗?

pdf uiwebview ios

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

带有过滤器的搜索栏和带有Ionic 2的JSON数据

我对Typescript和Ionic 2很新,我试图通过Ionic 2搜索栏过滤json响应.

这是我的代码:

import {Component} from '@angular/core';
import {NavController} from 'ionic-angular';
import {Http} from '@angular/http';
import 'rxjs/add/operator/map';



@Component({
  templateUrl: 'build/pages/home/home.html'
})
export class HomePage {

  posts: any;
  private searchQuery: string = '';
  private items: string[];
  constructor(private http: Http) {

    this.initializeItems();

    this.http.get('https://domain.co/open.jsonp').map(res => res.json()).subscribe(data => {
        this.posts = data;
        console.log(this.posts);

    });

  }

  initializeItems() {
    this.items = this.posts;
  }

  getItems(ev: any) {
    // Reset items back to all of the items
    this.initializeItems();

    // set val to the value of the searchbar …
Run Code Online (Sandbox Code Playgroud)

typescript ionic-framework ionic2 ionic3 angular

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

如何在添加之前检查特定对象是否已存在于数组中

我有这个数组:

[{"name": "Olvier", "id": 123 }, {"name": "Olvier", "id": 124 }]
Run Code Online (Sandbox Code Playgroud)

现在我的目标是防止再次将相同的对象添加到数组中:

{"name": "Olvier", "id": 123 }
Run Code Online (Sandbox Code Playgroud)

有没有办法做到这一点?

javascript ecmascript-6

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

localhost:3000/home.html 在 chrome 中打开 google 搜索

每当我localhost:3000/home.html在 chrome 中打开时,chrome 不会将其识别为 URL,而是将其识别为搜索词。

localhost:3000/home.html#工作没有问题。 localhost:3000/projects.html也有效。(以及任何其他 URL)

这是什么原因造成的?还有其他人有这个问题吗?

url google-chrome gulp webpack

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

使用 ionic 4 导航回标签索引

我有一个带有 5 个选项卡的选项卡布局。当我导航到第二个选项卡然后导航到子页面时,导航回ion-back-button第一个选项卡上的土地。如何返回上次选择的选项卡?

非常感谢任何帮助!

const routes: Routes = [
  { path: '', loadChildren: './tabs/tabs.module#TabsPageModule' },
  { path: 'home', loadChildren: './home/home.module#HomePageModule' },
  { path: 'timetable', loadChildren: './timetable/timetable.module#TimetablePageModule' },
  { path: 'artistDetail/:id', loadChildren: './artist-detail/artist-detail.module#ArtistDetailPageModule' },
  { path: 'artist', loadChildren: './artist/artist.module#ArtistPageModule' },
];
Run Code Online (Sandbox Code Playgroud)

标签路线:

const routes: Routes = [
  {
    path: 'tabs',
    component: TabsPage,
    children: [
      {
        path: '',
        redirectTo: '/tabs/(home:home)',
        pathMatch: 'full',
      },
      {
        path: 'home',
        outlet: 'home',
        component: HomePage
      },
      {
        path: 'timetable',
        outlet: 'timetable',
        component: TimetablePage
      },
      { …
Run Code Online (Sandbox Code Playgroud)

ionic-framework angular ionic4

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

如何使用angular2和Typescript隐藏android actionbar?

我有一个简单的html文件:

<StackLayout orientation="vertical" actionBarHidden="true">
      <Image src="res://buy" stretch="none" horizontalAlignment="center"></Image>
</StackLayout>
Run Code Online (Sandbox Code Playgroud)

但是当我使用时:

<Page actionBarHidden="true">
  <StackLayout orientation="vertical">
      <Image src="res://buy" stretch="none" horizontalAlignment="center"></Image>
  </StackLayout>
</Page>
Run Code Online (Sandbox Code Playgroud)

它会中断页面​​。.操作栏未隐藏,并且内容和操作栏之间有巨大的空白。

我为我的应用程序使用angular2和打字稿。

我怎么了

任何帮助,不胜感激!

android typescript nativescript

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

在使用离子拨打电话号码时获取net :: ERR_UNKNOWN_URL_SCHEME

我在config.xml中有这个代码

<content src="index.html"/>
<access origin="*"/>
<allow-navigation href="tel:*" />
<allow-intent href="tel:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="http://*/*"/>
<allow-navigation href="tel:*"/>
<allow-navigation href="http://*/*"/>
<allow-navigation href="https://*/*"/>
<access origin="mailto:*" launch-external="true" />
<access origin="tel:*" launch-external="true" />
Run Code Online (Sandbox Code Playgroud)

这在HTML中:

<a ng-href="tel:{{item.phone}}"><h3>Anrufen</h3></a>
Run Code Online (Sandbox Code Playgroud)

item.phone返回0331234567

在index.html中:

<meta name="format-detection" content="telephone=yes">
Run Code Online (Sandbox Code Playgroud)

我的错是什么?

angularjs ionic-framework

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

容器与子元素的高度不同

容器只有屏幕高度的3/4左右,这与子元素的高度不同.

这是为什么?

我试图给容器和身体一个,min-height: 100%但这不起作用.即使!important

我不使用bootstrap,只是简单的html和CSS.

任何帮助非常感谢!

编辑:更改正文或html高度不起作用.这打破了页面.

我有一个带有以下CSS的正文:

body {
  background-image: url("../img/1.png");
  background-repeat: repeat;
  background-size: cover;
  font-family: "Raleway", sans-serif;
  font-size: 20px;
  font-weight: 300;

}
Run Code Online (Sandbox Code Playgroud)

容器有这个CSS规则:

.container {
  width: 900px !important;
  margin: auto;
  padding-left: 20px;
  padding-right: 20px;
  background-color: rgba(255, 255, 255, 0.3);
  height: 100% !important;
}
Run Code Online (Sandbox Code Playgroud)

我的标记看起来像这样:

  <body>
    <div class="container">
      <div class="header">
        <div class="lang">
          <ul class="languages">
            <li>DE</li>
            <li>FR</li>
          </ul>
        </div>
        <img src="img/header/royalpool.png" alt="" class="logo-royal"/>
        <img src="img/header/bluetech.png" alt="" class="logo-bluetech"/>
        <div class="lang">
          <ul class="languages">
            <li>Kontakt</li>
            <li>Downloads</li>
            <li>Händler</li>
          </ul>
        </div>
        <ul …
Run Code Online (Sandbox Code Playgroud)

html css

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

如何使用nativescript,angular2和typescript更改iOS状态栏颜色?

所以我发现这个npm包:https://www.npmjs.com/package/nativescript-statusbar

但我无法使用Page元素,因为我使用的是angular和typescript.

我已经做到了这个:

this.page.backgroundSpanUnderStatusBar= true;

但我的背景颜色是黑色.

我需要来自iOS的光状态栏.

这可能吗?

任何帮助非常感谢!

angularjs typescript nativescript

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

没有绝对定位的图像划分

我坚持这个...我的目标是这个页面:

在此输入图像描述

我想在图像上放置文本,例如"STALDEN".我知道如何做到这一点,但是当我使用绝对定位并插入新条目时,文本与之前的文本位于同一位置.我该如何更好地解决这个问题?

任何帮助非常感谢!

这就是我所拥有的:

<div class="karte">
      <img src="img/home/stalden.png" alt="">
      <h1>STALDEN</h1>
    </div>
Run Code Online (Sandbox Code Playgroud)

CSS

.karte img {
  width: 100vw;
}


.karte h1 {
  position: absolute;
  top: 50px;
  left: 50px;
  color: white;
  font-family: "Teko", sans-serif;
  font-size: 15vw;
}
Run Code Online (Sandbox Code Playgroud)

html css

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