小编Fre*_*kyB的帖子

javascript从年,月,日创建日期

我正在尝试创建一个新datejavascript.

我有year,monthday.在教程之后,创建new的语法date应该是:

new Date(year, month, day, hours, minutes, seconds, milliseconds)
Run Code Online (Sandbox Code Playgroud)

这正是我在做的事情:

var d = new Date(2016, 12, 17, 0, 0, 0, 0);
Run Code Online (Sandbox Code Playgroud)

这应该是2016年12月17日,但在我的控制台输出中,我看到:

Tue Jan 17 2017 00:00:00 GMT+0100 (Central Europe Standard Time)
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

javascript jquery

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

将HTML导出为PDF始终在新页面的底部对齐

我遇到导出HTML到PDF的问题.我希望底部的部分始终在新页面的底部对齐.

现在这一部分(当涉及到分页符时)在新页面的顶部对齐:

在此输入图像描述

该部分的代码:

<div style='page-break-inside:avoid;vertical-align:bottom;'>
<font face="Verdana"  >
<br>
        <table cellspacing="0" cellpadding="0" style="width:900px;">
          <tbody>
			<tr>
				<td style="width:500px">
					BLAGO DOSTAVIL:&nbsp;______________________<br/><br/>
					Podpis<br/><br/>
					Datum:&nbsp;______________________
				</td>
				<td>
					BLAGO PREVZEL:&nbsp;______________________<br/><br/>
					Podpis<br/><br/>
					Datum:&nbsp;______________________
				</td>
				
			</tr>
		  </tbody>
        </table>
</font>
<font face="Verdana" size="1"  >
<br /><br />
        <table cellspacing="0" cellpadding="0" style="width:900px;">
          <tbody>
            <tr>
              <td style="text-align:center">
				<i>
					testting d.o.o., testing, ID za DDV: testing, mati?na št.: testing
					<br>
					tel: +386 XXXXXXXXXX, fax: +386 1 XXXXXXXXX, e-mail: info@XXXX.si, web: www.xxxxxxx.si
					<br>
					Družba je vpisana pri okrožnem sodiš?u v Ljubljani, št. …
Run Code Online (Sandbox Code Playgroud)

html css

14
推荐指数
2
解决办法
1966
查看次数

如何删除项目 - Visual Studio Team Services

我正在使用VS 2015和Visual Studio Team Services.我创建了几个项目,现在我想删除其中一些项目.我找不到删除项目的选项.我错过了什么吗?

tfs azure-devops

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

Scripts.Render 抛出“对象未设置为对象的实例”错误

我正在使用 Visual Studio 2019。

我有一个以前没有遇到过的问题 - 在视图中,这一行(只是这一行)抛出错误:

@Scripts.Render("~/scripts/scriptCommon")
Run Code Online (Sandbox Code Playgroud)

我检查了捆绑配置:

ScriptBundle scriptCommon = new ScriptBundle("~/scripts/scriptCommon");
      scriptCommon.Include("~/static/scripts/jquery-1.11.0.min.js");
      scriptCommon.Include("~/static/scripts/bootstrap.min.js");
Run Code Online (Sandbox Code Playgroud)

这两个文件都在文件系统上。

该捆绑包还添加到具有以下内容的捆绑包中:

bundles.Add(scriptCommon);
Run Code Online (Sandbox Code Playgroud)

(就像所有其他捆绑包一样)

我不明白为什么会出现这个错误?可能是什么原因?

简短的错误消息:

System.NullReferenceException: Object reference not set to an instance of an object.
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

堆栈跟踪:

[NullReferenceException: Object reference not set to an instance of an object.]
   Microsoft.Ajax.Utilities.ActivationObject.DefineField(INameDeclaration nameDecl, FunctionObject fieldValue) +20
   Microsoft.Ajax.Utilities.ActivationObject.DefineLexicalDeclarations() +92
   Microsoft.Ajax.Utilities.BlockScope.DeclareScope() +4
   Microsoft.Ajax.Utilities.ResolutionVisitor.CreateFields(ActivationObject scope) +35
   Microsoft.Ajax.Utilities.ResolutionVisitor.CreateFields(ActivationObject scope) +77
   Microsoft.Ajax.Utilities.ResolutionVisitor.CreateFields(ActivationObject scope) +77
   Microsoft.Ajax.Utilities.ResolutionVisitor.CreateFields(ActivationObject scope) +77
   Microsoft.Ajax.Utilities.ResolutionVisitor.Apply(AstNode node, ActivationObject scope, CodeSettings settings) +62
   Microsoft.Ajax.Utilities.JSParser.Parse(CodeSettings settings) +972
   Microsoft.Ajax.Utilities.Minifier.MinifyJavaScript(String source, CodeSettings codeSettings) …
Run Code Online (Sandbox Code Playgroud)

.net c# asp.net-mvc

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

发布后Google登录无法正常工作

我用的是VS2015,C#.

我在使用Google登录时遇到问题.从我的调试配置(localhost)一切正常.发布到服务器后,谷歌登录窗口根本无法打开.并且没有例外.这是我的代码:

[AllowAnonymous]
public async Task LoginWithGoogle()
{
    HttpRequest request = System.Web.HttpContext.Current.Request;
    string redirectUri = ConfigurationReaderHelper.GetGoogleRedirectUri();

    try
    {            
        ClientSecrets secrets = new ClientSecrets
        {
            ClientId = "***",
            ClientSecret = "***"
        };

        IEnumerable<string> scopes = new[] { PlusService.Scope.UserinfoEmail, PlusService.Scope.UserinfoProfile };

        GoogleStorageCredentials storage = new GoogleStorageCredentials();

        dsAuthorizationBroker.RedirectUri = redirectUri;
        UserCredential credential = await dsAuthorizationBroker.AuthorizeAsync(secrets,
            scopes, "", CancellationToken.None, storage);
    }
    catch(Exception ex)
    {
        throw ex;
    }            
}


//just getting value from applicationSettings - web.config
            public static string GetGoogleRedirectUri()
            {
    #if DEBUG
                return GetValueFromApplicationSettings("RedirectUriDEBUG"); …
Run Code Online (Sandbox Code Playgroud)

c# google-login google-plus

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

导出为PDF时,表行没有分页符

当表导出为PDF时,表行不会进行分页.我试图在每个表行上进行分页:

<tr style='page-break-inside:avoid;'>
Run Code Online (Sandbox Code Playgroud)

表行中断如下(导出到PDF - 在浏览器中查看):

在此输入图像描述

我希望桌子排'Vrsta blaga/storitve'保持紧凑.因此,单元格不会显示在不可打印的区域中,如上图所示.这可能吗?我应该使用什么造型?这是我的代码:

<style>#tblArticles{font-size: 12px !important; font-family: verdana, sans-serif; border-collapse: collapse; width: 100%;}
#tblArticles td{border: 1px solid black;text-align: center;padding: 8px;}
#tblArticles th {border: 1px solid black;text-align: center;padding: 8px;background-color: #dddddd;}
</style>
<style>#tblLeft{position:absolute;left:0; font-size: 10px !important; font-family: verdana, sans-serif;border-collapse:collapse; width:40%;}
#tblLeft td{font-size: 10px !important; border: 1px solid black;text-align: center;padding: 8px;}
#tblLeft th {font-size: 10px !important; border: 1px solid black;text-align: center;padding: 8px;background-color: #dddddd;}</style>
<style>#tblRight{position:absolute;right:0; font-size: 10px !important; font-family: verdana, sans-serif;border-collapse:collapse; width:20%;}
#tblRight td{font-size: 10px !important; text-align: center;padding: 8px;}</style> …
Run Code Online (Sandbox Code Playgroud)

html css pdf

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

VS2022 - 匹配的外部大括号未在 javascript 中标记

Visual studio 2022 - 我刚刚安装了 VS2022,注意到外部大括号(内部的一些嵌套元素)不再像以前一样被标记。例子:

在此输入图像描述

但它仍然适用于非嵌套括号:

在此输入图像描述

知道为什么会发生这种情况吗?

2023 年 10 月编辑:最新版本的 Visual Studio:Microsoft Visual Studio Community 2022(64 位)中问题仍然存在。当前版本 17.6.3

visual-studio visual-studio-2022

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

投影快照中的长度计算不一致

在 Visual Studio 2017 中,我工作时发生了一些意想不到的事情。我正在编辑剃刀视图(没什么特别的,只是普通编辑 - 我复制粘贴了一小块文本),突然间我收到了这条消息:

在此处输入图片说明

我尝试重新启动 Visual Studio,删除 suo 文件,删除我的临时文件夹......现在我无法在这个特定视图中工作。如果我尝试更改此 .cshtml 中的任何内容,则会收到上面的消息或此消息:

在此处输入图片说明

这是什么?我不记得在以前版本的 Visual Studio 中看到过这个。如何避免这种情况并继续工作?

visual-studio

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

VS2019 - msbuild 不被识别为内部或外部命令

我正在使用 VS2019 社区,并且已经设置了预构建事件:

msbuild "$(ProjectPath)" /t:Clean
Run Code Online (Sandbox Code Playgroud)

我收到错误:

  'MSBuild' is not recognized as an internal or external command,
  operable program or batch file
Run Code Online (Sandbox Code Playgroud)

这怎么可能?这个命令不应该内置到visual studio中吗?

我已经检查过这个并尝试设置路径环境,但它没有帮助。

在 VS2019 中,有没有其他人对这个命令有同样的问题?

msbuild visual-studio

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

Angularjs $ interval返回fn不是函数

我想检查cookie是否存在$ interval.我在页面加载时调用$ interval.此调用会定期抛出错误:

> TypeError: fn is not a function
>     at callback (angular.js:12516)
>     at Scope.$eval (angular.js:17444)
>     at Scope.$digest (angular.js:17257)
>     at Scope.$apply (angular.js:17552)
>     at tick (angular.js:12506)
Run Code Online (Sandbox Code Playgroud)

我真的不明白为什么.

这是我的代码:

angular.module("appModule")
.controller("loginController", ["$scope", "$http", "$window", "$document", "$interval", "$cookies",
    function ($scope, $http, $window, $document, $interval, $cookies) {

    var stopInterval;
    $scope.CheckLoginCookie = function () {

        if ($cookies.get("Login") != null) {

            if (angular.isDefined(stopInterval)) {
                $interval.cancel(stopInterval);
                stopInterval = undefined;
            }

            $window.location.href = $scope.UrlNotes;
        }
    }

    $scope.Repeat = function ()
    {
        stopInterval = …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs

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