小编rin*_*t.6的帖子

为什么我的回调说"未定义不是函数?

我正在使用这样的回调调用函数:

$(function() {
    //get all the items
    search.init('.result tbody tr');
    search.parseresults(function(announcementID){
        //query every single page
        var myCompany = new company(announcementID);
        myCompany.requestPage(function(){
            //on response parse the data.
            myCompany.parsedata()
            var myPerson = new person(myCompany )
            myPerson.getPhone(function(){
                console.log('test')
            });
        })
    });
});
Run Code Online (Sandbox Code Playgroud)

这是使用console.log('test')的最后一个回调问题.

这是getPhone函数:

person.prototype.getPhone = function(callback){
    this.attempt++
    if( this.attempt === 1){
        var who = this.lastname;
        var where = this.adress+' '+this.postal;
    }else if(this.attempt === 2){
        var who = this.firstname+' '+this.lastname;
        var where = this.adress+' '+this.postal;
    }else{
        var who = this.firstname+' '+this.lastname;
        var where …
Run Code Online (Sandbox Code Playgroud)

javascript jquery

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

为什么没有定义html2canvas?

如果我正在调用此函数,则始终"未定义html2canvas".

makeScreenshot: function(button)
{
    debugger;
    html2canvas(document.body, {
        Uncaught ReferenceError: html2canvas is not defined
        onrendered: function(canvas) {
            document.body.appendChild(canvas);
        }
    });
},
Run Code Online (Sandbox Code Playgroud)

但为什么?我有一类它...就像在教程中写的那样.有没有人有办法解决吗?

我想我需要在这里包含html2canvas,但我不知道如何.

Ext.define("TEST.controller.Desktop", {
    extend: "Ext.app.Controller",

    views: [
        "desktop.Desktop",
        //"desktop.TaskBar",
        "desktop.Toolbar",
        "desktop.DataprovidersDataView",
        "configuration.UploadFileWindow"
    ],

refs: [{
    ref: "viewport",
    selector: "viewport"
}, {
Run Code Online (Sandbox Code Playgroud)

javascript extjs extjs4 html2canvas

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

在CSS中裁剪带圆角边框的图像

是否可以使用CSS裁剪图像,使其具有圆形边框?

原始图像

在此输入图像描述

裁剪图像

在此输入图像描述

我如何在CSS中执行此操作?

css image css3

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

无论屏幕大小如何,都将DIV居中到页面中心

无论屏幕大小如何,我都希望将下面的div容器置于页面中心显示的位置.

http://penarthpc.com/~droneboy/

我玩了一会儿,但似乎错过了一些东西.

html css wordpress

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

Nuget PM Visual Studio Express v2013中出错

我无法从Nuget包管理器中解决此错误.

我尝试过卸载T4 Scaffolding并重新安装.我在Visual Studio 2012中使用3个更新开发了此程序,现在已将程序迁移到VS Express 2013该程序在2012版本中没有错误.我搜索了互联网,Nuget和这个网站,但我无法解决这个问题.我应该提到我在包装中有MvcMailer,它似乎依赖于T4脚手架.答案将不胜感激.

 Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\T4Scaffolding.Core.1.0.0\tools\init.ps1:50 
char:9
+         Set-DefaultScaffolder -Name CustomTemplate -Scaffolder 
T4Scaffolding.Cus ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
At E:\Visual Studio 
2012\Projects\ArtsProject\packages\T4Scaffolding.Core.1.0.0\tools\init.ps1:51 
char:9
+         Set-DefaultScaffolder -Name CustomScaffolder -Scaffolder 
T4Scaffolding.C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Set-DefaultScaffolder], Inval 
   idOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet

Set-DefaultScaffolder : Cannot …
Run Code Online (Sandbox Code Playgroud)

visual-studio-express nuget

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

php严格错误包括

如果类在这样的文件中,则看起来不会发生严格错误:

abstract class Food{}

class Meat extends Food{}                    

abstract class Animal{          
    function feed(Food $food){ }
}

class Cat extends Animal{           
    function feed(Meat $meat){
        parent::feed($meat);
    }   
}    
Run Code Online (Sandbox Code Playgroud)

但是如果你把类定义放在单独的文件中并包含它们:

abstract class Food{}

class Meat extends Food{}                    

require 'Animal.php';
require 'Cat.php';
Run Code Online (Sandbox Code Playgroud)

抛出严格的标准错误消息:

严格标准:声明Cat::feed()应与Animal::feed(Food $food)c:\ path\to\Cat.php在线兼容......

如果all都在一个文件中,即使这样也可以:

class Dog extends Animal{           
  function feed($qty = 1){ 
    for($i = 0; $i < $qty; $i++){
        $Meat = new Meat();
        parent::feed($Meat);
    }       
  } 
}
Run Code Online (Sandbox Code Playgroud)

这是预期的行为吗?

因为Meat是a Food,首先不应该有抱怨,对吧?因此解决方案简单明了:将所有内容放在一个文件中并满足严格的标准;)

任何提示赞赏

php strict

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

信任自签名证书CentOS 7

我正在为开发服务器生成一个自签名证书,但我需要它才能被信任才能使用一些将使用该证书的工具.

这是我尝试过的:

openssl req -newkey rsa:2048 -x509 -nodes -keyout /etc/ssl/private/server.key -new -out /etc/ssl/certs/server.crt -reqexts v3_req -extensions v3_req -config /vagrant/openssl.san.conf -sha256 -days 1825

ln --symbolic /etc/ssl/certs/server.crt /etc/pki/ca-trust/source/anchors/server.crt

update-ca-trust extract
Run Code Online (Sandbox Code Playgroud)

在尝试运行update-ca-trust命令之后,我尝试使用grepping ca-bundle.crt文件获取内容,server.crt但它不在那里.

我也尝试过复制文件而不是制作符号链接,但这也不起作用.

证书是正确创建的,适用于Apache,但它会产生自签名错误:

[vagrant@localhost certs]$ curl --head https://localhost/
curl: (60) Issuer certificate is invalid.
More details here: http://curl.haxx.se/docs/sslcerts.html
Run Code Online (Sandbox Code Playgroud)

如何在服务器的命令行上信任我的自签名证书?

certificate ca self-signed ssl-certificate centos7

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

在条形图顶部设置值-echarts

如何在 e-charts / ngx-echarts 库中的条形图顶部设置值?让我知道是否存在相同的属性,我无法找到任何属性?

我想要的结果:在此输入图像描述

到目前为止我能够实现的结果:在此输入图像描述

组件:-

import {Component, Input, OnInit} from '@angular/core';

declare var echarts: any;
@Component({
 selector:'app-bar-chart',
 templateUrl:'./bar-chart.component.html',
 styleUrls:['./bar-chart.component.css'],
})


export class BarChartComponent implements OnInit{

public barChartData;

ngOnInit() {
let dataAxis = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K','L'];
let data = [200, 180, 190, 233, 219, 203, 110, 250, 160, 130, 120, 263];
this.barChartData  ={
  xAxis: {
    data: dataAxis,
    axisLabel: {
      textStyle: {
        color: 'black'
      }
    },
    axisTick: {
      show:true
    },
    axisLine: …
Run Code Online (Sandbox Code Playgroud)

javascript echarts angular

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

通过iPhone SDK创建FB Open Graph对象

我正在为iPhone制作音乐播放器,我希望用户能够将歌曲发布到他们的时间轴上.我有Facebook Connect工作,我已经注册了Open Graph对象和Facebook的动作,但我无法弄清楚如何从iOS创建/发布对象和动作.

Facebook给了我以下代码,但我不知道在哪里使用它的iOS SDK.

<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# MYAPPNAME: http://ogp.me/ns/fb/MYAPPNAME#">
<meta property="fb:app_id"      content="xxxxxxxxxxxxxxx" /> 
<meta property="og:type"        content="MYAPPNAME:song" /> 
<meta property="og:url"         content="Put Your Own URL Here" /> 
<meta property="og:title"       content="Some Arbitrary String" /> 
<meta property="og:description" content="Some Arbitrary String" /> 
<meta property="og:image"       content="http://ogp.me/logo.png" /> 
Run Code Online (Sandbox Code Playgroud)

facebook opengraph ios facebook-timeline facebook-ios-sdk

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

Rails 4相当于Rails 3'Mode.all'

在Rails 3中,如果我想点击db,我会在查询结束时使用.all.这对于我在写入时刷新缓存(因此读取总是命中缓存)这一点非常有用.

现在在Rails 4中,Model.all返回一个ActiveRecord::Relation对象(即没有命中db).让它真正进入数据库并返回指定记录的最佳方法是什么?

ruby-on-rails ruby-on-rails-4

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