小编Ist*_*ván的帖子

如何在JavaScript中创建具有多个空格的字符串

通过创建变量

var a = 'something' + '        ' + 'something'
Run Code Online (Sandbox Code Playgroud)

我得到这个价值:'something something'.

如何在JavaScript中创建一个包含多个空格的字符串?

html javascript whitespace space html-entities

29
推荐指数
3
解决办法
8万
查看次数

SVG与变换矩阵坐标

我想在矩形元素上实现像svg-edit这样的功能

  1. 旋转矩形
  2. 调整
  3. 拖动

旋转SVG矩形它工作正常,但是当我想调整矩形大小时它有问题.坐标不正常; 我使用变换矩阵进行旋转,targetelement.setAttribute(transform,rotate(45,cx,cy)) 但是当旋转 元素时,会移动坐标.我也使用inverse函数来反转变换矩阵它解决了问题,但它不适用于拖动函数.

html5 svg

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

textarea元素中的换行符

这是纯HTML.(没有php或类似的东西,如果你想在Web视图中知道它是一个带有HTML的C#应用​​程序的背景).

我的所有HTML文件格式都很好,并且正确缩进以便于维护等.

这是一段摘录:

<tr>
    <td class="label">Clinic Times:</td>
    <td><textarea name="familyPlanningClinicSessionsClinicTimes">Monday:
    Tuesday:
    Wednesday:
    Thursday:
    Friday:
    Saturday:
    Sunday:</textarea></td>
</tr>
Run Code Online (Sandbox Code Playgroud)

在换行符<textarea></textarea>元素是那里得到换行符在页面上.但是它还包括textarea元素中的缩进.

例如

例

我能想到删除此问题的唯一方法是删除缩进.它不是世界末日,但有另一种方式,保持良好的格式?谢谢.

html css internet-explorer textarea

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

如何通过父窗口CSS类将CSS应用于内部Iframe元素?

我有一个父(主)页面有一些iframe部分.我想将css样式应用于内部iframe元素.

When I googling for it, I found many post relate to this topic but they all suggest to use jquery/javascript to apply CSS to inner elements.

Is it possible to apply css style to inner iframe element through parent window(main page) CSS class?

(All the iframe's domain is the same as the parent)

html css iframe css3

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

IE11中的CSS3 -ms-max-content

我们可以设置CSS3 -moz-max-content(适用于Firefox)和-webkit-max-content(适用于Chrome,Safari)width,但似乎-ms-max-content无法在Internet Explorer(IE11)中使用.

更新:这是一个示例代码:

.button {
    background: #d1d1d1;
    margin: 2px;
    cursor: pointer;    
    width: -moz-max-content;
    width: -webkit-max-content;
    width: -o-max-content;
    width: -ms-max-content;
}
Run Code Online (Sandbox Code Playgroud)
<div>
    <div class="button"> Short t. </div>
    <div class="button"> Looooooong text </div>
    <div class="button"> Medium text </div>   
</div>
Run Code Online (Sandbox Code Playgroud)

css css3 internet-explorer-11

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

angular-cli新项目中的webpack.config.js在哪里?

我正在研究webpack和angular-cli,即使angular-cli应该使用webpack,webpack.config.js当我创建一个新项目时,我看不到任何文件ng new

有人知道这在angular-cli中是如何工作的吗?

webpack angular-cli

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

如何在 Angular 中动态添加额外的路由

我在 Angular-CLI 和 .NET Core 2.0 中使用 Angular 5.2.2(打字稿)。

我正在尝试向我的应用程序动态添加其他路由。

这个想法是我从服务器动态获取我的路由,该服务器检查哪些模块应该可供用户使用。但我似乎无法获得可用的路线。

我尝试使用添加它们,RouterModule.forRoot但这不起作用。

我试过使用,Router.resetConfig但我似乎无法让它工作。我尝试使用依赖注入在我创建的函数中获取它,但我最终得到了循环依赖:

Uncaught Error: Provider parse errors:
Cannot instantiate cyclic dependency! ApplicationRef ("[ERROR ->]"): in NgModule AppModule in ./AppModule@-1:-1
Run Code Online (Sandbox Code Playgroud)

这是我拥有的一些代码:

app-routing.module.ts

import { NgModule, APP_INITIALIZER } from '@angular/core';
import { Routes, RouterModule, Router } from '@angular/router';

var routes: Routes = [{ path: '', loadChildren: "../app/modules/f2p-dashboard/f2p-dashboard.module#F2PDashboardModule" }];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule],
  providers: [
    {
      provide: APP_INITIALIZER,
      useFactory: AppConfigServiceFactory,
      deps: [F2PModuleService, Router ],
      multi: true
    } …
Run Code Online (Sandbox Code Playgroud)

typescript angular-routing angular angular-router angular5

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

仅重置div的css样式

好吧,我有一个很棒的HTML文档.我想对这个文件进行控制,但是这个控件的css样式与big html文件的样式重叠.如何仅为div(以及所有嵌套的div)重置所有样式?

html css

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

在Extjs中转换日期

我有一个以下格式的日期字符串:

'31-OCT-2013'

如何使用Extjs 4将其转换为以下格式的日期:

'08/31/2013'

我正在使用IE8.

extjs date

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

HttpOnly cookie不是通过请求发送的

我想使用HttpOnlycookie,我在Java中设置如下:

...

Cookie accessTokenCookie = new Cookie("token", userToken);
accessTokenCookie.setHttpOnly(true);
accessTokenCookie.setSecure(true);
accessTokenCookie.setPath("/");
response.addCookie(accessTokenCookie);
Cookie refreshTokenCookie = new Cookie("refreshToken", refreshToken);
refreshTokenCookie.setHttpOnly(true);
refreshTokenCookie.setSecure(true);
refreshTokenCookie.setPath("/");
response.addCookie(refreshTokenCookie);

...
Run Code Online (Sandbox Code Playgroud)

我得到了客户端的cookie响应,但是当我发送下一个请求时,我没有请求cookie.也许我错过了一些东西,但据我所知,这些HttpOnlycookie必须由浏览器在每次请求(JavaScript无法访问这些cookie)时发送到定义的路径.

我有以下请求标题:

Accept:application/json, text/plain, */*
Accept-Encoding:gzip, deflate, br
Accept-Language:en-US,en;q=0.8,hu;q=0.6,ro;q=0.4,fr;q=0.2,de;q=0.2
Authorization:Basic dXNlcm5hbWU6cGFzc3dvcmQ=
Connection:keep-alive
Content-Length:35
content-type:text/plain
Host:localhost:8080
Origin:http://localhost:4200
Referer:http://localhost:4200/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36
X-Requested-With:XMLHttpRequest
Run Code Online (Sandbox Code Playgroud)

以及以下响应标头:

Access-Control-Allow-Credentials:true
Access-Control-Allow-Origin:http://localhost:4200
Access-Control-Expose-Headers:Access-Control-Allow-Origin, Content-Type, Date, Link, Server, X-Application-Context, X-Total-Count
Cache-Control:no-cache, no-store, max-age=0, must-revalidate
Content-Length:482
Content-Type:application/json;charset=ISO-8859-1
Date:Fri, 03 Feb 2017 13:11:29 GMT …
Run Code Online (Sandbox Code Playgroud)

java cookies jwt cookie-httponly angular

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