小编bvi*_*ale的帖子

Chrome值加载

我在浏览器Chrome时遇到一些问题,它会记住密码,用户名等.我无法检查输入字段是否为空.我使用以下代码,但if语句在Chrome中不起作用,而它适用于所有其他浏览器.

$(document).ready(function() {    
    $('.inputWithLabel').each(function(){
        if ($(this).val().length != 0){
            var element_id = $(this).attr('id');
            $('label[for="' + element_id + '"]').addClass('inputWithText');
        }
    });
});
Run Code Online (Sandbox Code Playgroud)

我试图改变以下标签

<form action="" method="post">
    <div class="divInputLabel inputLabel">
        <label class="labelInput" for="username">Brugernavn*</label>
        <input class="inputLabel inputWithLabel" id="username" name="username" type="text">
    </div>
    <div class="divInputLabel inputLabel">
        <label class="labelInput" for="password">Adgangskode*</label>
        <input class="inputLabel inputWithLabel" id="password" name="password" type="password">
    </div>
    <div class="divInputLabel inputLabel">
        <label class="labelInput" for="password_again">Gentag adgangskode*</label>
        <input class="inputLabel inputWithLabel" id="password_again" name="password_again" type="password">
    </div>
    <div class="divInputLabel inputLabel">
        <label class="labelInput" for="first_name">Fornavn*</label>
        <input class="inputLabel inputWithLabel" id="first_name" name="first_name" type="text">
    </div>
    <div …
Run Code Online (Sandbox Code Playgroud)

javascript jquery google-chrome

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

Cordova ibeacon; 在应用程序被杀后发送本地通知,但在android上无效

我正在我的cordova项目中使用Cordova/Phonegap iBeacon插件ionicframework.当应用程序被杀死时,我正在尝试使用cordova本地通知插件在android和ios上发送本地通知.

这是我的代码:

document.addEventListener("deviceready", onDeviceReady, false);

    function didDetermineStateForRegion(pluginResult) {
    }

    function didStartMonitoringForRegion (pluginResult) {
    }
    function didExitRegion(pluginResult) {
        $cordovaLocalNotification.add({
        id: 30244234234,
        title: "Good By!",
        text: "Hope to see you again."
            }).then(function () {
            });
    }

    function didEnterRegion (pluginResult) {
        $cordovaLocalNotification.add({
        title: "Welcome",
        text: "Tap to launch app"
            }).then(function () {

            });

    };
    function didRangeBeaconsInRegion (pluginResult) {

    }

    function onDeviceReady() {
        // Now safe to use device APIs
        function createBeacon(uuid,nofiyState) {

            var uuid = uuid; …
Run Code Online (Sandbox Code Playgroud)

javascript android cordova ibeacon ionic-framework

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

使用webpack优化Angular 2应用程序构建持续时间

我构建了一个Angular 2应用程序并将其与webpack捆绑在一起.目前,我的应用程序仍然很小,但webpack任务已经需要大约10秒钟.是否可以优化我的webpack配置或TypeSript编译选项以改进编译和打包持续时间?

这是我使用的webpack配置:

var webpack = require('webpack');
var LiveReloadPlugin = require('webpack-livereload-plugin');

module.exports = {
  entry: __dirname + '/assets/app/app.ts',
  output: {
    filename: 'myApp.bundle.js',
    path: __dirname + '/build/'
  },
  // Turn on sourcemaps
  devtool: 'source-map',
  resolve: {
    extensions: ['.ts', '.js']
  },
  plugins: [
    new LiveReloadPlugin({
      appendScriptTag: true
    }),
    // Fixes angular 2 warning
    new webpack.ContextReplacementPlugin(
      /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
      __dirname
    )
  ],
  module: {
    rules: [{
        enforce: 'pre',
        test: /\.js$/,
        loader: "source-map-loader"
      },
      {
        enforce: 'pre',
        test: /\.tsx?$/,
        use: "ts-loader"
      }
    ]
  }
}
Run Code Online (Sandbox Code Playgroud)

和tsconfig: …

javascript typescript webpack ts-loader angular

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

在Chrome上打印Bootstrap表时出错

当我想在Chrome下打印我的网页时,我有一个奇怪的错误.我使用Bootstrap显示一个表,它完全符合屏幕尺寸(无论屏幕大小是多少).当我想在Chrome下打印网页时,表格会被裁剪,而打印布局非常适合使用Firefox.

我已经设法在这里重现我在JSFiddle上的错误.

我表的html代码是:

<table class="table table-condensed">
    <thead>
        <tr>
            <th>Col1</th>
            <th>Col2</th>
            <th>...</th>
        </tr>
    </thead>
    <tbody>
        <tr ng-repeat="...">
            <td>...</td>
            <!-- ... -->
        </tr>
        <tr class="separator empty" />
    </tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

你有任何想法解决这个问题吗?
也许为表使用不同的Bootstrap css类?

html css google-chrome twitter-bootstrap angularjs

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

SQL:空列上的FULL OUTER JOIN

我想FULL OUTER JOIN在几个列上使用两个表之间,但是当两个列都为null时,它们在连接期间不被视为相等,因此我获得两个不同的行.如何编写连接,所以null列被认为是相等的?

我已经设置了一个简化的例子:

create table t1 (
 id number(10) NOT NULL,
 field1 varchar2(50),
 field2 varchar2(50),
 CONSTRAINT t1_pk PRIMARY KEY (id)
);

create table t2 (
  id number(10) NOT NULL,
  field1 varchar2(50),
  field2 varchar2(50),
  extra_field number(1),
  CONSTRAINT t2_pk PRIMARY KEY (id)
);

insert into t1 values(1, 'test', 'test2');
insert into t2 values(1, 'test', 'test2', null);

insert into t1 values(2, 'test1', 'test1');
insert into t2 values(2, 'test1', 'test1', null);

insert into t1 values(3, 'test0', null);
insert into t2 values(3, …
Run Code Online (Sandbox Code Playgroud)

sql oracle join outer-join

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

使用XSLT的"路径中的非法字符"

当我调用XslCompiledTransform类的Transform方法时,我得到了"路径中的非法字符"异常.

这是我的代码:

// Maybe there is a problem in this path 
string xsltPath = @"..\..\HtmlAttributesParser.xslt";

XslCompiledTransform xsltCompiled = new XslCompiledTransform();
xsltCompiled.Load(xsltPath, new XsltSettings(false, true), new XmlUrlResolver());
StringBuilder output = new StringBuilder();

xsltCompiled.Transform(content, XmlWriter.Create(output));
Run Code Online (Sandbox Code Playgroud)

没有*?"<> |在我的路径中所以我想知道为什么我会得到这个例外.

关于Exception消息,我的内容var的值与此异常之间没有关联吗?

编辑:以下是适用于在线XSLT测试人员的内容

<div class="pk-link">
<a href="/STORE/Pages/myPage.aspx" url="/STORE/Pages/myPage.aspx" width="" heigth=""  target="_blank">
    <img border="0" src="/link_download.gif"/>
      Download
</a>
</div>
Run Code Online (Sandbox Code Playgroud)

.net c# xslt illegal-characters

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

获取Angular范围变量长度

我需要得到Angular模型的长度$scope.我的代码警报undefined.
但是scope当我scope没有警报时,它有一个价值length

alert($scope.comppostal.length)
Run Code Online (Sandbox Code Playgroud)

如何检查长度?内容$scope.comppostal12345

javascript angularjs

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