我刚从bitbucket克隆了一个角度为6的项目,做过npm install以及所有相关的任务,它似乎运行良好,但是当我尝试使用angular-cli工具" ng generate component" 生成一个新组件时,我得到了错误
"在629位置的JSON中出现意外的令牌/
我怎样才能解决这个问题?
我正在使用grunt-accessibility插件来自动报告accessibility错误.它通常工作正常,但是当我在一个网站上尝试它时self signed certificate(显示一个interim带有一些证书安全警告的页面并且如果你仍然希望继续访问该网站的链接),它会报告错误interim页面本身,当然是一个空页面:
<html>
<head></head>
<body></body>
</html>
Run Code Online (Sandbox Code Playgroud)
显然我想绕过这个临时页面并accessibility在实际页面上运行.
我在尝试什么?
我曾尝试过以下内容(通过谷歌搜索和其他SO's问答):
臭名昭着的黑客
npm set strict-ssl false
Run Code Online (Sandbox Code Playgroud)添加导入的证书路径
npm config set cafile="C:\path\to\cert.cer"
Run Code Online (Sandbox Code Playgroud)添加process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"(见Grunfile下文)
从我收集,grunt-accessibility使用AccessSniff反过来使用phantomjs.现在,phantomjs可以选择忽略此类警告
--ignore-ssl-errors=[true|false]忽略SSL错误,例如过期或自签名证书错误(默认为false).
以上是CLI选项,我无法从中传递Grunfile.js.有人可以帮我解决或提出另一种方法来解决这个问题.
这是我的Gruntfile.js:
module.exports = grunt => {
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
grunt.initConfig({
phantomjs: {
// default: {
options: {
"ignore-ssl-errors": true,
// tested here with different instructions …Run Code Online (Sandbox Code Playgroud) 我正在玩try - catch块:
<?php
try {
$str = "http://rejstrik-firem.kurzy.cz/73631604";
$domOb = new DOMDocument();
$html = $domOb->loadHTMLFile($str);
$domOb->preserveWhiteSpace = false;
$container = $domOb->getElementById('ormaininfotab');
echo $container; // <========= this is intended error which I want catch
}
catch (Exception $e) {
echo "Exception" . $e->getMessage() . ". File: " . $e->getFile() . ", line: " . $e->getLine();
}
catch (Error $e) {
echo "Error" . $e->getMessage() . ". File: " . $e->getFile() . ", line: " . $e->getLine();
}
?> …Run Code Online (Sandbox Code Playgroud) 它不应允许前导零,例如099. 允许的值应如下所示:35, 99, 1, 2, 3, 100。
这是我尝试过的:
$('#createCoupon_discountAmount').bind('input propertychange', function () {
$(this).val($(this).val().replace(/(\d\d?|100)\Z/g, ''));
});
Run Code Online (Sandbox Code Playgroud) 我正在nativescript开发一个网络广播应用程序和 nativescript-audio插件来读取流。在 Android 上我没有问题,但在iOS方法上:
sharedSession.dataTaskWithUrlCompletionHandler(URL, function(data, response, error)) 返回错误 = {}
这是我的Info.plist 的一部分
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>radioking.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>Run Code Online (Sandbox Code Playgroud)
这是我的网址:https : //www.radioking.com/play/jobradio 流格式为 mp3
插件调用:
private player = new TNSPlayer();
public initFromUrl(url : string, autoPlay : boolean = false) {
// Initialize player
this.player.initFromUrl({
audioFile: url,
loop: false,
completeCallback: () => {
this.player.dispose().then(() => { });
},
errorCallback: args => { }, …Run Code Online (Sandbox Code Playgroud) javascript ×2
angular-cli ×1
gruntjs ×1
ios ×1
jquery ×1
nativescript ×1
node.js ×1
phantomjs ×1
php ×1
regex ×1
try-catch ×1